Bane of pop-ups and pop-up blockers

Don't we all hate pop-up windows pop-ups that try to sell us everything from discounted airline tickets to unmentionable-s. There are myriad pop-up blockers now to counter these popping monsters. In fact all browsers now come with in-built blockers. The trouble with these however is that when as a developer you have some genuine functionality to show in a cute child window instead of the parent window itself, it gets blocked too! And the user may be unaware of this....

The javascript below does not prevent a genuine window from being blocked but gives a prominent alert to the user about the blockage.


<SCRIPT LANGUAGE="JavaScript">
<!--
function blocker()
{
mywin = window.open('show.html',"","left=100,top=50,
height=600, width=700, statusbar=no");
if (!mywin) alert("A window was blocked. Please disable
your blocker or whitelist this website");
}
//-->

<BODY onload=blocker()>


Comments