I really liked how the new Twitter and Facebook saved downloaded pages, instead dynamically loading content via ajax. I want to start rolling it over to my sites, but I don't know where to start.
Twitter and Facebook now have uri:
http://twitter.com/#!/messages
$(document).ready(function () {
if(window.location.hash) {
$("div#content").load(window.location.hash);
} else {
$("div#content").load("http://localhost/home/");
}
$('ul#menu li a').click(function() {
$("div#content").load(window.location.hash);
});
});
html for the menu i have:
<ul id="menu">
<li>< a href="#">logout</a></li>
<li>< a href="#!/settings">settings</a></li>
<li>< a href="#!/messages" class="notify">messages <span>3</span></a></li>
<li>< a href="#!/profile">profile</a></li>
<li>< a href="#!/" class="selected">home</a></li></ul>
Any idea how Facebook or Twitter does it?
source
share