I'm using the .load() function to load my content, as shown in this code:
$(document).ready(function(){
$("nav a").click(function () {
$("#main-content").load($(this).attr("href") + " #content > *");
return false;
});
});
The style and scripts are contained in index.php.
When the content is loaded, it only includes the content inside a div without the head, body, or any styles.
There are some problems that I've encountered:
- In IE8, the styles are not loading and the function is not working properly:
$(document).ready(function() {
if ($(window).width() < 630) {
$('aside').each(
function(){
$(this).parents('article').find('h2').after(this);
}
);
}
if ($(window).width() > 630) {
$('aside').each(
function(){
$(this).parents('section').after(this);
}
);
}
});
$(window).bind('resize', function(){
if ($(window).width() < 630) {
$('aside').each(
function(){
$(this).parents('article').find('h2').after(this);
}
);
}
if ($(window).width() > 630) {
$('aside').each(
function(){
$(this).parents('section').after(this);
}
);
}
});
I have attempted to fix it by adding the following script:
$(document).ajaxComplete(function(){ });
However, this solution did not work for me. Any help would be greatly appreciated.