为什么jquery不在IE8中工作,而是在chrome/firefox中工作

为什么jquery不在IE8中工作,而是在chrome/firefox中工作,jquery,internet-explorer,Jquery,Internet Explorer,我在IE8中的jQuery代码有问题。 我有一个脚本,在加载div时动态构造一些UI。 这在chrome和firefox中运行良好,但在IE中无法加载。 它在下面第二行不记录任何内容 AV.console.debug("start customer UI"); e = $("<div></div>").addClass("av-webassist-main").hide(); AV.console.debug("customerUI added main containe

我在IE8中的jQuery代码有问题。 我有一个脚本,在加载div时动态构造一些UI。 这在chrome和firefox中运行良好,但在IE中无法加载。 它在下面第二行不记录任何内容

AV.console.debug("start customer UI");
e = $("<div></div>").addClass("av-webassist-main").hide();
AV.console.debug("customerUI added main container");
它在控制台中记录第一次调试,之后什么也不记录。页面保持空白。 如果我尝试在控制台中运行第二行

e = $("<div></div>").addClass("av-webassist-main").hide();
它抛出错误“null”为null或不是对象
我不知道如何调试这个。我正在使用jquery-1.9.1.js。

删除或注释掉您的console.debug行。IE会阻塞它们,除非控制台打开。

删除或注释掉您的console.debug行。除非控制台打开,否则IE会阻塞它们。

是否加载了jQuery?试试这个:

if (jQuery) {  
    alert('jQuery is loaded');
} else {
    alert('jQuery is not loaded');
}
如果用另一种方式创建DIV呢?像

$(document.createElement('div'))

这会改变什么吗?

是否加载了jQuery?试试这个:

if (jQuery) {  
    alert('jQuery is loaded');
} else {
    alert('jQuery is not loaded');
}
如果用另一种方式创建DIV呢?像

$(document.createElement('div'))

这会改变什么吗?

AV.console.debug$.fn.jquery;给你?我想我把它放在调试线上面后它就断了。不过控制台中没有错误。然后我在控制台脚本中运行了$.fn.jquery,它说=>'$.fn.jquery'为null或不是object,$.prototype在您记录它时会给您什么?在$之后,它显示日志添加的$function{var elements=new Array;for var i=0;i'$.fn.jquery'为null或不是object,$.prototype在您记录它时会给您什么?在$之后,它显示日志添加的$function{var elements=new Array;for var i=0;i