I have a trouble getting in an responseText property of xhr object. When I'm trying to get access directly for xhr variable, I'm getting an [object Object];
$.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);
}
});
This trouble reveals in IE-8 with XP OS installed. Anybody help me, plesase.
try to add dataType
property to the options , it can be html , JSON , xml or text