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

Popular posts from this blog

Maven Crash Course - Learn Power Query, Power Pivot & DAX in 15 Minutes

"Data Prep & Exploratory Data Analysis" course by Maven Analytics

Oracle Cloud Infrastructure 2024 Generative AI Professional Course & Certification Exam (1Z0-1127-24)