...

View Full Version : history.go(+1) doesn't do it's thing here



tpeck
02-03-2007, 05:02 AM
I have another problem that is probably solveable but not with history.go(+1), which is what I would expect.

I want to be able to go from page 1 to page 2 in two ways.

You can do it by clicking on the numbers and the back button does its job as you would expect.

But using the "go" button (enter the lesson number) seems to bypass the back button's history.

The (cutdown) page demonstrating the problem is here:

http://aapress.com.au/demo/backforward/L01-05/L01/001/001.html

The way the go button works is fine and goes to page 2 nicely from page 1, but no history update.

It must have something to do with this function in the routine:


function gopage() {
var ex = document.getElementById('exField').value;
top.location.replace(getPath(ex));
return false;
}

I tried placing 'history.go(+1)' into that function but it didn't change anything. I don't understand why. (Because of the 'replace'?)

_Aerospace_Eng_
02-03-2007, 08:23 AM
Try top.location = getPath(ex); instead.

tpeck
02-03-2007, 08:59 AM
As you can see, that certainly fixed it.

Many thanks indeed!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum