Collections:
Other Resources:
Popup Windows Triggers When Pages Are Loaded
How to trigger popup windows automatically when pages are loaded with JavaScript?
✍: FYIcenter.com
If you want to generate a popup window whenever a Web page is loaded, you can use the "onload" attribute in the HTML BODY tag to call a predefined JavaScript function. See the following JavaScript code outline:
<body onload="pBodyOnloadTest();">
...
/*
* Popup Blocker Test - P_BODY_ONLOAD
* - Popup Windows Triggered by Page Loading Events
*
* A popup window shows up when a page is loaded into the
* browser. JavaScript codes implemented on the onload
* 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 pBodyOnloadTest() {
fyicenterWin = window.open('', 'Popup', 'toolbar=no,sc...
fyicenterWin.document.write('<html><body bgcolor="#eee...
fyicenterWin.document.write('<p><b>P_BODY_ONLOAD Test<...
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_ONLOAD page to get the complete source code and to see how it works.
2007-01-17, ∼8811🔥, 0💬
Popular Posts:
Why am I getting this authentication failed message when adding my cell phone as a bluetooth device ...
What is AcroIEHelper.dll - DLL file - Adobe Acrobat IE Helper Version 6.0 for ActiveX? DLL AcroIEHel...
Where to find information about what services are running on Windows 8 and how to manage them? I wan...
Failed to connect to a windows service. Windows could not connect to windows all user install agent ...
Why HelpSvc.exe Is Causing Windows XP to Stop Responding - Using High CPU and Memory? Many users hav...