View Single Post
  #4 (permalink)  
Old March 4th, 2010, 12:54 AM
PeterPeiGuo PeterPeiGuo is offline
Friend of Wrox
Join Date: Dec 2008
Location: , , .
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts

As for the solution that Old Pedant provided, that line with history.go(-2) should be removed. The code won't work unless special condition is met.

If there is no page -2 to go (for example you view the testing page using a brand new tab), your code will work as history.go(-2) takes no effect in this case. Otherwise you will be led away from the testing page upon the first execution of the script.
Reply With Quote