Created
August 23, 2011 10:34
-
-
Save tbtlr/1164818 to your computer and use it in GitHub Desktop.
A simple JavaScript that lets you use your browser's back/forward buttons for in-page navigation by adding custom 'next' and 'previous' events to the window object.
:P
Is this intended for fun or production code? If fun, please ignore the following:
Feels like it would be weird to go to a page and have my forward button enabled even if I hadn't used the back button yet.
Its cool I have tested in modern browsers but in IE9 it has some issues its not working. Is that because we have to use attachEvent() function? please suggest.
It is not working in mac safari browser :(
One thing you must know when using this script, is that you "loose" some data i.e. $_POST
when you reload a form that has already been submitted (it should be annoying in some cases).
Line 20 should be using an evaluation === not an assignment =
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copyright 2001? Amazing foresight on pushState! :)