Solved

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

Posted on 2004-08-27
3
166 Views
Last Modified: 2006-11-17
Hi,

I have the following code in the head of my HTML page:
-----------
<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
redirTime = "5000";
redirURL = "http://www.ddk.co.uk";
function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
//  End -->
</script>
-----------
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
0
Comment
Question by:gjirvine3000
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Colosseo earned 125 total points
ID: 11910622
Hi there

try changing your function to this

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

this will open the redirURL into a new window

HTH

Scott
0
 

Author Comment

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

Expert Comment

by:Colosseo
ID: 11910652
No bother mate

thanks for the grade :)

Cheers

Scott
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
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…

773 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