我在获取xhr对象的responseText属性时遇到了问题。当我试图直接访问xhr变量时,我得到了一个对象对象;
$.ajax({
'url': that.data('url'),
'async': false,
'type': 'get',
'beforeSend': function() {
onBeforeSend(that);
},
'success': function(res, req, xhr) {
alert(xhr);
alert(xhr.responseText);
if ((typeof res == 'undefined') && (typeof xhr == 'undefined')) {
res = (function() {
try {
return new (this.XMLHttpRequest||ActiveXObject)('MSXML2.XMLHTTP.3.0');
} catch (e) {
alert('Exception');
}
});
}
container.html(res.responseText);
},
'error': function(res, xhr) {
container.html(res.responseText);
},
'complete': function() {
onComplete(that);
}
});此故障在安装了XP操作系统的IE-8中显示。有谁能帮帮我,求求你。
发布于 2014-06-02 22:56:28
尝试将dataType属性添加到选项中,它可以是html、JSON、xml或文本
https://stackoverflow.com/questions/23996449
复制相似问题