At the moment I am trying to create a setup where page content is loaded within the main to avoid having to refresh the page for every link.
I am using jQuery load as follows for every link that is clicked so that the link is loaded into the #main. (Obviously it won't be all links when complete.)
Pages visited directly work fine but if you try and use this load link then it will load the content correctly but only shows the loaded html in view source, am I doing something wrong here?
$("body").on("click", "a", function(){
$("#footer, #main").fadeOut('fast');
$("#main").load($(this).attr("href"), function(){
$("#main, #footer").fadeIn('slow');
});
return false
});