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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

734 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