...

View Full Version : onload history back



jely076
09-08-2011, 12:31 AM
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:



<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

jely076
09-08-2011, 12:33 AM
the only reason I used


alert("");

is because that was the only way I could get the history back to work. Any suggestions?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum