I have some ajax get request on the web page and it works perfectly fine in Firefox and Chrome. But it is not working with IE at all. After some research, I found out I need to specify the dataType and allow cross domain.
Before I have,
$.ajax({
type: "GET",
url: 'http://example.com/abc',
error: function (xhr, statusText) {
//log error
},
success: function (data) {
//process data
}
});
}
After I have specify the dataType, contentType and crossDomain, it works straight away.
$.ajax({
dataType: "jsonp",
contentType: "text/json; charset=utf-8",
crossDomain: true,
type: "GET",
url: 'http://example.com/abc',
error: function (xhr, statusText) {
//log error
},
success: function (data) {
//process data
}
});
}
This little tip saved my day!