问题
I want to implement the header as like twitter has. I have observed couple of things like when i click on home link, the url has changed but still page header is not loaded and the content of the page is changed. Can anybody give me some suggestion so that i can put that design on my site?
UPDATE
I have seen this site : 1, 2
I am wondering that how twitter manages offline site. Because I have tried couple of example for application caching, and i have got warning on my firefox browser about page storing. While I am opening twitter site on firefox this warning dosen't appear. What could be the reason. I have also observe that twitter is using locaStorage first time. What is the concept behind twitter offline site caching?
回答1:
As Cyberfox already mentioned - it's called browser state. The JS-framework BackboneJS implements this method for you: http://documentcloud.github.com/backbone/.
More specific: http://documentcloud.github.com/backbone/#History-start
回答2:
As Twitter is a mix of good CSS and very much of AJAX, jQuery is probably what you're looking for. (http://jquery.com/)
回答3:
You want the history methods (pushState
, popState
) in HTML5, or the hash-bang operations in HTML4.
Here's a comprehensive overview of the state of the art in history munging, and browser state: https://github.com/browserstate/history.js/wiki/Intelligent-State-Handling
...along with a library (history.js) to help.
来源:https://stackoverflow.com/questions/8984868/twitter-offline-site-concept