Twitter offline site Concept

无人久伴 提交于 2019-12-24 07:59:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!