jQuery Ajax不适用于每个版本的Internet Explorer
The following piece of code works well on Internet Explorer 9 and 10 but gives no result in Internet Explorer 7 and 8.
以下代码在Internet Explorer 9和10上运行良好,但在Internet Explorer 7和8中没有结果。
$.ajax({
url: url,
cache: false,
async: true,
success: function(req, textStatus, obj) {
},
error: function(req, error, exc) {
alert(req.responseText);
}
});
The result of the URL called by the Ajax request is:
Ajax请求调用的URL的结果是:
<?xml version="1.0"?>
<BRILJANT>
<VP>
<NETTOVP>45,4545</NETTOVP>
<NETTOVPINCL>55</NETTOVPINCL>
<BRUTOVP>45,4545</BRUTOVP>
<BRUTOVPINCL>54,9999</BRUTOVPINCL>
<ORIVP>55,43</ORIVP>
<ORIVPINCL>67,0703</ORIVPINCL>
<KORTING1>0</KORTING1>
<KORTING2>0</KORTING2>
<SOORTPRIJS>P</SOORTPRIJS>
</VP>
<TEL>
<VOORRAAD>0</VOORRAAD>
<INBACKLEV>0</INBACKLEV>
<INBACKKLA>6</INBACKKLA>
<CONSIGN>0</CONSIGN>
<MAGCTRL>0</MAGCTRL>
<INPROD>0</INPROD>
<OPAFLEVER>0</OPAFLEVER>
<VOORRRES>0</VOORRRES>
<VOORZPROD>0</VOORZPROD>
</TEL>
</BRILJANT>
In Internet Explorer 7 and 8, the request object content is empty even if no error message is mentioned.
在Internet Explorer 7和8中,即使未提及错误消息,请求对象内容也为空。
Any idea is well appreciated!
任何想法都很受欢迎!
2 个解决方案
#1
1
jQuery 2.0 dropped support for oldIE (<9), so if you are using the latest version there may be incompatibilities with IE7 & 8 so you should be using version 1.10 at most. If you are using a 1.X version, it is helpful to provide the version, as you may be using a version with a known bug.
jQuery 2.0删除了对oldIE(<9)的支持,因此如果您使用的是最新版本,则可能与IE7和8不兼容,因此您最多应使用1.10版本。如果您使用的是1.X版本,则提供版本会很有帮助,因为您可能正在使用具有已知错误的版本。
更多相关文章
- 使用Selectize和Ajax时,在Bootstrap模式中显示Rails错误消息
- WCF获取URL长度限制问题:错误的请求-无效的URL。
- jQuery版本选择问题
- 为什么这个jQuery。ajax不会引发错误吗?
- 点击JSON数据加载Galleria画廊。我需要新鲜的眼睛来看我的错误
- jQuery:离线后发布错误(iOS和Chrome)
- 【jQuery】判断浏览器类型和版本
- 在线请教调用Jquery错误:TypeError: a is undefined 的错误原因
- 在发出xml Ajax请求时获取错误412