Forum Moderators: open

Message Too Old, No Replies

history.forward()

         

artie2004

12:48 am on Aug 6, 2007 (gmt 0)

10+ Year Member



Hi. Could someone tell me why the history.forward() only gets called when i click the browser's back button when i try to return to the page but not when i return to that page without clicking on the back button? Here is the code to my page>

<html>
<head>
<title>Back Button Demo: Page One</title>
<script>
function backButtonOverride()
{
// Work around a Safari bug
// that sometimes produces a blank page
setTimeout("backButtonOverrideBody()", 1);

}

function backButtonOverrideBody()
{
// Works if we backed up to get here
try {
history.forward();
} catch (e) {
// OK to ignore
}
// Every quarter-second, try again. The only
// guaranteed method for Opera, Firefox,
// and Safari, which don't always call
// onLoad but *do* resume any timers when
// returning to a page
setTimeout("backButtonOverrideBody()", 500);
}
</script>
</head>
<body onLoad="backButtonOverride()">
<h1>Back Button Demo: Page One</h1>
<a href="page2.html">Advance to Page Two</a>
</body>
</html>

syktek

8:15 pm on Aug 6, 2007 (gmt 0)

10+ Year Member



you only get forward history when you press the back button.