Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to redirect to another page after 1 second? 1

Status
Not open for further replies.

kippie

Technical User
Nov 8, 2001
158
I would like to redirect a visitor of a page1 automatically after 1 second to a page2. But then I would like to have page1 also open together with page2. Is this possible?

Kippie

 
[tt]

Here you go:

<HEAD>

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>

redirTime = &quot;1000&quot;;
redirURL = &quot;Your Page&quot;;
function redirTimer() { self.setTimeout(&quot;self.location.href = redirURL;&quot;,redirTime); }
</script>


<!-- STEP TWO: Insert the onLoad event handler into your BODY tag -->

<BODY onLoad=&quot;redirTimer()&quot;>

[tt]
&quot;The only ideas that will work for you are the ones you put to work.&quot;
[/tt]

 
Hi Tonyu,

Thanks for your reaction. This works nice, but the new URL is not opened in a new window. Can that be done also?

Kippie
 
[tt]
Sorry, I don't know too much JS to know how to open two window at once. Perhaps you could explain what you're trying to do...

banana.gif
rockband.gif
Banana.gif

 
try this:

Code:
<HTM>
<HEAD>
<SCRIPT>
function delayedWindow()
{
window.open(&quot;[URL unfurl="true"]http://www.echoecho.com&quot;);[/URL]
}
</SCRIPT>
</HEAD>
<BODY onLoad=&quot;window.setTimeout('delayedWindow()',100)&quot;>
TEST
</BODY>
</HTML>

Tested and works on IE 6
 
Thanks,

This is perfect!

Kippie
 
[tt]
kippie,
As future reference, when someone provides you with a helpful/expert post/tip/solution, be polite and thank them with a
star.gif
. I have given y2k1981 one on your behalf.

Thanks
[/tt]

banana.gif
rockband.gif
Banana.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top