Web Analytics Made Easy -
StatCounter onload history back - CodingForum

Announcement

Collapse
No announcement yet.

onload history back

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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; Sep 7, 2011, 06:40 PM.

  • #2
    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; Sep 7, 2011, 06:42 PM.

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎