Results 1 to 3 of 3

Thread: referring history automatically ???

  1. #1
    Join Date
    May 2010
    Posts
    34
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Red face referring history automatically ???

    Hi,
    • I have a form in my site.when the form is submit successfully it's go to another page, which shows "submission is success".

    • and that page has a link to go back to a page which is viewing previously(before to form)

    • this is the code for it
    • Code:
      <a href="javascript:history.go(-2)">Go back to previous</a>

    I want to know, how to go to previous page by automatically? this should be happen after 10 seconds!

    please help me....

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    Hi hansan, I tried something like this
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Go back to previous page after a delay</title>
    
    <script type="text/javascript">
    function goBack(){
    history.go(-1);
    }
    </script>
    </head>
    
    <body onLoad="setTimeout('goBack()', 10000)">
    <h1> Return to previous page after 10 seconds</h1>
    </body>
    </html>
    which seem to work. I don't know if it's correct to do it this way. It takes me back to the previous page, but you could probably change the -1 to -2 to get you to the page before the previous page, if that's what you need. The milliseconds ( 10000) can be changed to whatever needed.

  3. #3
    Join Date
    May 2010
    Posts
    34
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    that's working. thnax

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •