开发者

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

开发者 https://www.devze.com 2023-02-17 22:51 出处:网络
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 g

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. Curren开发者_JS百科tly i am looking in to this but anyway may be some one come across something similar.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消