Skip to content

Instantly share code, notes, and snippets.

@cameroncox
Created August 2, 2008 20:39
Show Gist options
  • Save cameroncox/3775 to your computer and use it in GitHub Desktop.
Save cameroncox/3775 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
if (String(window.location).match(/#/i)) {
matches = String(window.location).match(/#(.*)/)
$('#contents').load(matches[1] + '.html #container #contents *');
}
$('ul li').find('a').each(function(i, link) {
$(this).click(function(i, a) {
var uri = $(this).attr('href');
$('#contents').empty();
$('#contents').load(uri + ' #container #contents *');
window.location = '#' + uri.replace(/.html/, '');
return false;
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment