0

I want to add some items in history using javascript? Is there any way to do it?

Thanks in Advance !

Uday

Uday
  • 1
  • 1

1 Answers1

1

I believe what you are looking for is:

history.pushState( stateObj, title, url );

And definitely read: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history

History states definitely still have limitations in terms of cross-browser compatibility, so if you are looking to solve for old versions of IE, etc... you may need to just update the #hashmark on the url.

  • Thanks for the reply but but unfortunately it doesn’t support IE browser. Can you please suggest some solution for it? – Uday Jul 05 '11 at 11:47
  • If using jQuery is an option, I highly recommend this plugin: http://benalman.com/projects/jquery-hashchange-plugin/ It focuses on using the history api, but with jQuery's support provides a cross-browser solution. – Jacob Swartwood Jul 08 '11 at 14:28