SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Mar 14, 2004, 22:27 #1
- Join Date
- Oct 2001
- Location
- Its all about location
- Posts
- 652
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Redirecting using timeout and history.back
I'm wanting to set a timeout for a page using the setTimeout function. I'm also wanting to send the user back to the page they were just at when the timer is hit. I've been using the following code:
Code:<script language='javascript'> onload = function() { setTimeout(history.back(-1), 5000); } </script>
-
Mar 15, 2004, 00:56 #2
- Join Date
- May 2003
- Posts
- 1,843
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can anyone tell me what I'm doing wrong?
<script type="text/javascript">
onload = function()
{
setTimeout('history.go(-1)', 5000);
}
</script>::: certified wild guess :::
-
Mar 17, 2004, 15:11 #3
- Join Date
- Oct 2001
- Location
- Its all about location
- Posts
- 652
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ah, it would be the single quotes that I missed. Thank you!
Bookmarks