4-10-2010
jQuery load();
Use AJAX to change pages in your site plus giving the user the possibility to link to that page by using URL Hashs: #.
This technique is starting to get popular in a few big sites. The best example I know is probably The Hype Machine, which has an mp3 player in the bottom and the songs keeps playing when you change the page(Only for logged in users). Twitter is also using it in the homepage(again, when logged in) and the user pages.
This is the jQuery code that I used on this site, it only affects the permalinks in the left of each post.
Code:
$(document).ready(function(){ var loc = window.location.hash.toString(); if ( loc != '' ) { var url = loc.replace("#", ""); $("#container").load(url + " #content", null, getTitle); } $(".post .info a.permalink").click(function() { var url = $(this).attr("href"); document.location.href = "#"+url; $("#container").load(url + " #content", null, getTitle); return false; }); function getTitle(r, t, xml) { title = r.match(""); document.title = title[1]; } });