Page 1 of 1

location.href

Posted: Wed Jan 11, 2006 10:42 am
by gurjit
Hi,

What I want to do and having so much trouble doing is:

I have a page that loads up. When it loads up and some one puts an extension to the url e.g.

http://www.myurl.co.uk/surrey

I want new browser to open. But not with window.open but like clicking a href link like

Code: Select all

<a href="mypage.php" target="_blank">open the page</a>
how can i make it happen so that "open the page" link gets clicked onload and mypage.php opens in a new window.

Posted: Wed Jan 11, 2006 10:58 am
by neophyte
<body onload="window.location(some parms);">

Posted: Wed Jan 11, 2006 11:33 am
by gurjit
window.location will open in the same window....

how do i get it to target="_blank"

Posted: Wed Jan 11, 2006 12:20 pm
by feyd
window.open is the real way to correctly set a target.

You could use onload to simulate a click on a "link" (doesn't have to be visible to the user) that will open the window..