Experiences with Javascript History Frameworks

前端 未结 4 704
不思量自难忘°
不思量自难忘° 2021-01-05 01:26

I\'m seeking a javascript history framework to handle navigation inside a page when the user selects multiple options which change the page behaviour.

There are mult

4条回答
  •  别那么骄傲
    2021-01-05 02:07

    Maybe this question is usefull to you. In the question I linked to a testpage, where location.hash is used to keep track of the history. I am currently using this method in a testsite and experienced problems with Opera (truncates a location.hash value at the question mark, you'll have to use: location.href.split(/#/)[1]) and of course IE (needs an iframe). In IE with iframe the history is saved for the current session only. If you load another page in the same window/tab and use the back button to go back to the AJAX page, the previous history is lost. It's not that big a deal for me, but may be annoying. I understood that IE8s history should behave like expected with location.hash, it even should have a hashchange handler.

    I think most of the frameworks use the same technique (monitoring location.hash for changes, using an iframe for IE). I didn't want to use a framework, because I'm using my own home brew small framework and regular frameworks contain too much functionallity I'll never use.

提交回复
热议问题