Click to See Complete Forum and Search --> : Open new window when page loads


JonathanC
06-13-2004, 07:00 PM
I know how to make a page redirect, and I know how to make a button (or link) open a page in a new window. But how can I create a page so that, when it loads, it automatically opens another page in a new window above it?
This seems to work in IE6 (Windows):

page = window.open('url','windowid','toolbar=1,
menubar=1,location=1,status=1,
scrollbars=1,resizable=1,width=w,
height=h');history.go(-1);

(although I'm not sure exactly why - I'm pretty new to JavaScript)
... but not in Safari.
The solution needs to work in Safari, as well as IE (Windows & Mac).

David Harrison
06-13-2004, 07:59 PM
Like this:<body onload="window.open('other_page.html');">

JonathanC
06-13-2004, 10:58 PM
Thanks. It works fine in IE5.2 (Mac OS X) but unfortunately not in Safari. :-(
Does Safari deliberately block this? Is there a workaround?
Regards,
Jonathan Cooper

fredmv
06-13-2004, 11:11 PM
I'd imagine Safari comes with a pop-up blocker. And since this is an unrequested window it catches it and thus, the window doesn't open. Several other real browsers contain this feature too such as Mozilla. The only option you have, really, is to provide a link to this file for those who have some sort of pop-up blocker running.