I would try adding some form of validation on the value you are passing. Also: you say it doesn't work but you don't say how it doesn't work (e.g. "it refreshes the current page"; or "it goes back to 1st page plus 1")
Cribbed from w3:
The go(delta) method causes the UA to run the following steps:
1. If the argument to the method was omitted or has the value zero, then act as if the location.reload() method was called instead, and abort these steps.
2. Let delta be the argument to the method.
3. If the index of the current entry of the joint session history plus delta is less than zero or greater than or equal to the number of items in the joint session history, then the user agent must do nothing.
4. Let specified entry be the entry in the joint session history whose index is the sum of delta and the index of the current entry of the joint session history.
5. Let specified browsing context be the browsing context of the specified entry.
6. Traverse the history of the specified browsing context to the specified entry.
I'm not using either, but: what does
javascript:alert(window.history.length)
give you? (Just copy & paste into the location/address bar, of the window that has iGoogle loaded.) – Arjan – 2010-12-01T16:47:51.520It gives me the correct number (was
19
for Google news, which does a refresh via href=... [see above]). Tried to check window.onunload and body.onunload they're all undefined. – Ring Ø – 2010-12-01T16:49:52.817Maybe lower the number a bit, like
javascript:window.history.go(-5)
to see what happens? – Arjan – 2010-12-01T16:51:55.980And: any errors when you open the Javascript console? (Just type
javascript:
to open that -- though that fails on my FF4 beta now.) – Arjan – 2010-12-01T16:54:54.063No error in Firebug. This is really strange... – Ring Ø – 2010-12-20T23:18:26.113
@ring0: Can you give an example of a such a page? – harrymc – 2010-12-27T18:42:50.063