Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    onload history back

    I need an html page that when visited automatically redirects the browser to return to the previous page it was on. here is the current code I have:

    Code:
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <script type="text/javascript">
      function load()
    {
    	history.go(-1)
            alert("");
    }
      
    </script>
    </head>
    
    <body onload="load()">
    <input type="button" value="Back" onclick="goBack()" />
    </body>
    </html>
    this works in firefox but in IE you have to press ok in the alert box before it returns. I admit I am a javascript novice. Any suggestions
    Last edited by jely076; 09-07-2011 at 11:40 PM.

  • #2
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the only reason I used
    Code:
    alert("");
    is because that was the only way I could get the history back to work. Any suggestions?
    Last edited by jely076; 09-07-2011 at 11:42 PM.


  •  

    Posting Permissions

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