How to get JavaScript redirect to open new URL in new browser window

Posted on 2004-08-27
Last Modified: 2006-11-17

I have the following code in the head of my HTML page:

<!-- Begin
redirTime = "5000";
redirURL = "";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
//  End -->
Please can someone tell me how I set the redirect URL to open in a new browser window rather than over the top of the current page? Can't figure it out!

Many thanks
Question by:gjirvine3000
  • 2
LVL 15

Accepted Solution

Colosseo earned 125 total points
ID: 11910622
Hi there

try changing your function to this

function redirTimer() { self.setTimeout(",\"child\");",redirTime); }

this will open the redirURL into a new window



Author Comment

ID: 11910634
Cheers Scott, works a treat! :-)
LVL 15

Expert Comment

ID: 11910652
No bother mate

thanks for the grade :)



Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (, typical array handling might look like this: (CODE) B…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now