问题描述
这是我的代码:(而不是其中的狡猾部分)
This is my code: (rather, the dodgy part thereof)
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
var requisicao=new XMLHttpRequest();
} else {
var requisicao=new ActiveXObject("Microsoft.XMLHTTP");
}
好的.有时这可以正常工作,但有时IE中的Javascript Debugger告诉我这一点:
Ok. Sometimes this works fine, but sometimes the Javascript Debugger in IE tells me this:
相当于…….
var requisicao=new XMLHttpRequest();
让我感到烦恼的是,有时IE 8会接受并继续运行,但有时会窒息而无法正常工作?
What bugs me is the fact that sometimes IE 8 accepts this and moves on but sometimes it chokes and doesn't work?
欢迎任何帮助
预先感谢
推荐答案
编辑:显然,在这种情况下,Internet Explorer的行号是正确的.这似乎是Internet Explorer 8的常见问题.这里有一个潜在的解决方案: Ajax应用程序可在一些浏览器,而不是其他浏览器.
Apparently, in this case, Internet Explorer's line number is correct. This seems to be a common problem with Internet Explorer 8. There's a potential solution here: Ajax app works in some browers, not others.
这是代码的相关部分:
try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
catch (e) { try { xmlhttp = new XMLHttpRequest(); }
catch (e) { xmlhttp = false; }}}
这篇关于IE 8中的AJAX不一致?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!