我使用此功能加载我的内容.load():IE不加载CSS .load()元素和JS不工作
$(document).ready(function(){
$("nav a").click(function() {
$("#main-content").load($(this).attr("href") + " #content > *");
return false;
});
});
index.php文件包含样式和脚本。
加载的内容只包含无头,正文或样式的div中的内容。
问题:
- IE8不加载样式&此功能不起作用:
$(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);
}
);
}
});
我已经试图修复它像其他脚本:
$(document).ajaxComplete(function(){ });
..但它没有奏效。
任何帮助是非常apprechiated。
该CSS已经链接在index.php的头部。 getscript()不能解决问题。 –
您正在使用'$(“#main-content”)。load($(this).attr(“href”)+“#content> *”)'只会加载与该选择器匹配的DOM元素。它不会抓取CSS(除非使用内联样式)。 – Blazemonger