Javascript to detect popup blocker

This simple javascript can be used to detect whether popup blocker is enabled on the browser.

<script type=”text/JavaScript” language=”JavaScript”>
var pop= window.open(”,”,’width=1,height=1,left=0,top=0,scrollbars=no’);
if(pop)
var popUpsBlocked = false
else
var popUpsBlocked = true
mine.close()
</script>

<script type=”text/JavaScript” language=”JavaScript”>
if(popUpsBlocked)
alert(‘Your browser’s popup blocker is enabled.\nPlease turn it off.’);
</script>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s