Reg
Reg

Reputation: 527

ASP.NET MVC 3.0/Javascript How to save browser history on click event

Is there any way to save browser history?

For example if some elements(enable/disable/color change, etc) on the page getting changed using jQuery and after redirecting to another action if browser go back button clicked the state of the previous page will be wrong.

That's why i am thinking to save history on button click before redirect, theoretically if user click back button state of previous page should be right.

Is there any ideas how to do that or something similar?

I found jQuery plugin called jHistory http://plugins.jquery.com/project/jHistory. Currently i am looking in to this but anyway may be some one come across something similar.

Upvotes: 1

Views: 1919

Answers (2)

James Sulak
James Sulak

Reputation: 32447

This sounds like a good candidate for the HTML 5 history API, which allows you to manipulate the history in a browser. Mark Pilgrim has an excellent introduction to it, along with instructions on how to detect if a browser supports it and fall back to scripts like history.js if it doesn't.

Chrome, Safari, and Firefox support the history API, while IE9 does not.

Edit: See also this question.

Upvotes: 1

Andrei
Andrei

Reputation: 4237

In addition to jquery plugin(http://plugins.jquery.com/project/jHistory) you can use reallysimplehistory JavaScript library

Upvotes: 0

Related Questions