Welcome to WebmasterWorld Guest from 54.162.108.167

Forum Moderators: open

Message Too Old, No Replies

JavaScript:history.go?

Is it possible to have it on a timer

     
4:51 pm on Aug 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


Is it possible to have the "go back" js on a timer where after a certain amount of time it goes back to the previous page?

<a href="JavaScript:history.go(-1)">

Any suggestions would be greatly appreciated!

-s-

5:00 pm on Aug 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 15, 2003
posts:2412
votes: 5


Perhaps this will do the trick:

<a href="JavaScript:setTimeout('history.go(-1)', 3000);"> 

/claus

5:04 pm on Aug 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


I am not sure that will work claus. The timer isn't fired unless you click the link, unless that is what you want stcrim? Just use the same code fired from what ever event you want. I would assume you would want it on the onload event like:

<body onLoad="goBack();">

With a the function goBack() in the code block:

<script>
function goBack(){
setTimeout('history.go(-1)', 3000);
}
</script>

5:29 pm on Aug 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


I will give'er a try...

Thank you very much!

-s-

5:40 pm on Aug 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


korkus2000

That is perfect - works like a charm

-s-

5:54 pm on Aug 25, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


claus' code, just different event :)

glad it worked.