2

I'm working on a project for a client and I wanted to hijack the browser's back button to navigate backwards through a javascript interface. I remember using w3schools.com frequently when I started learning javascript, and if you change anything in their preview/testing panel and resubmit, clicking the back button will take you back to the state the window was in last time you clicked the submit button.

I just picked a random page so you could see what I mean:

http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_sort

Just click submit a few times then hit the back button on your browser a few times.

How can I go about this? I'm sorry if it's a common question, but I've looked all over and just can't seem to track the solution down.

PSL
  • 123,204
  • 21
  • 253
  • 243
user3011922
  • 183
  • 3
  • 8
  • I actually would like to know how to do this as well. – DrCord Nov 25 '13 at 21:40
  • 2
    https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#Adding_and_modifying_history_entries – Quentin Nov 25 '13 at 21:41
  • Off-topic: w3schools sucks, see [w3fools](http://w3fools.com). [MDN](https://developer.mozilla.org/docs/Web) is much better. – Oriol Nov 25 '13 at 22:01
  • I don't use it anymore except for a quick syntax check once in a while, and agree that MDN is much more comprehensive. – user3011922 Nov 25 '13 at 22:06

0 Answers0