We'll use the same script as in the first example. Copy this script in the
<HEAD>
<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
This time, instead of running the script from a link we'll run it from the
onLoad<BODY ...>
<BODY onLoad="popup('autopopup.html', 'ad')">
The command in onLoadpopup(), but this time the first argument for popup() is a little different. In the previous example we put this, meaning the link itself, and the script got the URL from the link. In this case there is no link so we pass the actual URL to open. So in our example we put
'autopopup.html'.