Use JavaScript to determine whether the browser has disabled the pop-up window, and prompt the website viewer in a friendly way on the webpage.
Pop-up Blocker or other software that shields pop-up window advertisements (such as Google Toolbar) will shield any windows automatically opened by scripts except createpopup.
Some common functions affected by this are window. open (), showmodelessdialog (), showmodaldialog (), showHelp (), window. External. navigateandfind ().
The following JS can be used to detect and prompt the website viewer in a friendly way on the webpage.
Program code <HTML>
<Head>
<Title> settings in the pop-up window </title>
<Script language = JavaScript>
Function openwin ()
{
VaR sreturn = Window. Open ("http://www.geto.cn ");
If (sreturn = NULL)
{
Errorlog. innerhtml = "<font color = Red> the pop-up window on this site is blocked. Modify the browser configuration if you want to view the window! </Font> ";
}
}
</SCRIPT>
</Head>
<Body onload = "openwin ()">
<Div id = "errorlog"> </div>
</Body>
</Html>