location.href

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

location.href

Post 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.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

<body onload="window.location(some parms);">
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

Post by gurjit »

window.location will open in the same window....

how do i get it to target="_blank"
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
Post Reply