Categories:
Administration (10)
Adware Spyware (7)
Apache (10)
Bluetooth (125)
DOS Commands (1)
Edge (28)
General (2)
Internet Explorer (217)
Media Center (12)
Media Player (11)
Mozilla Firefox (18)
PHP (15)
Programming (8)
Security (4)
Silverlight (15)
Tips (17)
Tools (218)
Tutorials (5)
Windows 10 (166)
Windows 7 (636)
Windows 8 (1091)
Windows Phone (33)
Windows Server 2008 (165)
Windows Server 2012 (84)
Windows Server 2016 (23)
Windows Vista (52)
Collections:
Other Resources:
Popup Windows Triggers When Pages Are Unloaded
How to trigger popup windows automatically when pages are unloaded with JavaScript?
✍: FYIcenter.com
If you want to trigger a popup window whenever a Web page is unloaded, you can use the "onunload" attribute in the HTML BODY tag to call a predefined JavaScript function. See the following JavaScript code outline:
<body onunload="pBodyOnunloadTest();"> ... <script language="JavaScript"> /* * Popup Blocker Test - P_BODY_ONUNLOAD * - Popup Window Triggered by Page Unloading Events * * A popup window shows up when a page is unloaded from the * browser. JavaScript codes implemented on the onunload * event of the BODY tag. * * Version of 2007.01.01 * Download at http://sqa.fyicenter.com/tools/ * Copyright (C) 2007 FYIcenter.com. All rights reserved. */ function pBodyOnunloadTest() { fyicenterWin = window.open('', 'Popup', 'toolbar=no,sc... fyicenterWin.document.write('<html><body bgcolor="#eee... fyicenterWin.document.write('<p><b>P_BODY_ONUNLOAD Tes... fyicenterWin.document.write(' - Popup Window Triggered... fyicenterWin.document.write(' - Developed by FYIcenter... fyicenterWin.document.write('<p><img src="/popup_test_f... fyicenterWin.document.write('If you see this popup win... fyicenterWin.document.write('</body></html>'); fyicenterWin.document.close(); } </script>
You can also visit Popup Blocker Test - P_BODY_ONUNLOAD page to get the complete source code and to see how it works.
2007-01-17, 7871👍, 0💬
Popular Posts:
What is "Office Source Engine" in my Windows 7 service list? And how is "Office Source Engine" servi...
Where to find tutorials on using Edge Web browser. Here is a collection of tutorials on Edge Web bro...
How to download and install HiJackThis? If you want to download and install HiJackThis to your Windo...
How to download PHP engine for Windows systems? If you are interested in downloading a copy of PHP e...
What is "Office Software Protection Platform" in my Windows 7 service list? And how is "Office Softw...