homepage Welcome to WebmasterWorld Guest from 174.129.130.202
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
JavaScript:history.go?
Is it possible to have it on a timer
stcrim




msg:1475721
 4:51 pm on Aug 25, 2003 (gmt 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-

 

claus




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

Perhaps this will do the trick:

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

/claus

korkus2000




msg:1475723
 5:04 pm on Aug 25, 2003 (gmt 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>

stcrim




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

I will give'er a try...

Thank you very much!

-s-

stcrim




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

korkus2000

That is perfect - works like a charm

-s-

korkus2000




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

claus' code, just different event :)

glad it worked.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved