window.open not working onload

I am trying to pop up a window on my web site when my page loads and I cannot get the window.open command to work when I use it with the "onload" directive. Here is a the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->

<!-- 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=0,location=0,statusbar=0,men ubar=0,resizable=0,width=500,height=200,left = 262,top = 284');");
}
// End -->
</script>
</head>

<body onLoad="javascript:popUp('musicpage.php')">

This is a test...

</body>
</html>

Addl info:
I can get this to work if I put it in button using the "onclick" directive. It is only with "onload" that it does not work.

I have turned off the Pop Up blocker in IE.

I am running IE 6.0

Any ideas?
[1581 byte] By [admatthews] at [2007-11-20 2:19:02]
# 1 Re: window.open not working onload
You only have to put javascript: when it is not a general JavaScript function or event. Use the format below.

<body onload="function()">
PeejAvery at 2007-11-8 0:41:14 >
# 2 Re: window.open not working onload
Thanks...that did not work though...still no pop up window...

Could you get it to work for you?
admatthews at 2007-11-8 0:42:15 >
# 3 Re: window.open not working onload
The following works...

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
alert('hi');
day = new Date();
id = "page" + day.getTime();
id = window.open(URL, id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=200,left=262,top=284');
}
</script>
</head>

<body onload="popUp('musicpage.php')">

This is a test...

</body>
</html>
PeejAvery at 2007-11-8 0:43:12 >
# 4 Re: window.open not working onload
I still don't get a new window ??

The only that I saw was the alert window. After I clicked 'OK' I would have expected to see the other window pop up...

I got nothing...

R U using IE v6.x?
admatthews at 2007-11-8 0:44:18 >
# 5 Re: window.open not working onload
I still don't get a new window ??

The only that I saw was the alert window. After I clicked 'OK' I would have expected to see the other window pop up...

I got nothing...

R U using IE v6.x?

Do you run more then one Popup blocker? (for instance if you have Google toolbar + the IE one)
Alsvha at 2007-11-8 0:45:17 >
# 6 Re: window.open not working onload
R U using IE v6.x?
I works on IE6, IE7, Firefox, and Safari. You have to have another popup blocker. Test it by using...

<script language="JavaScript">
if(window.open('http://www.google.com')){alert('It worked. You must have a popup blocker.');}
</script>
PeejAvery at 2007-11-8 0:46:22 >
# 7 Re: window.open not working onload
You were correct... Norton had me blocked as well!

Thanks!
admatthews at 2007-11-8 0:47:18 >