Knowledge Base/3.0 Enhance your reader and publication/3.2 Enhance your pages (PAGE EDITOR)

Generate a Javascript Popup when a page is loaded (desktop platform)

Nathan Virtue
posted this on Feb 16 10:35 am

Want to display a popup window when a page is loaded/turned to by your audience?

A user shared the below javascript code that can do that job for you if placed into a custom script page widget. 

The values indicated in RED are changeable.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars= 1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left = 1030,top = 475');");
}
// End -->
</script>
</head>

<body>
<BODY onLoad="javascript:popUp('HTTP://WWW.THEPAGEYOUWANTELOADED.COM')">

<!-- Script Size: 0.73 KB -->
</body>

 

 

NOTE:  We are not responsible for behavior of 3rd party codes or scripts used within the platform.