AJAX Cross-Domain Requests with IE9

AJAX cross-domain requests (created using jQuery 1.7.2) are not executed in IE9 if the request dataType parameter is set to "jsonp" or "script".

I found this problem when accessing a request in which I was not interested in the answer, and left the dataType unspecified (yes, I know that I should take care of the answer).

So, for example, this will work:

$.ajax({
    url: "http://www.google.com",
    type: "GET", // or "POST"
    dataType: 'jsonp'
});

But it will not be:

$.ajax({
    url: "http://www.google.com",
    type: "GET" // or "POST"
});

By "work" I mean that I see an HTTP request made in Firebug or F12.

Both requests work in other browsers. Installation jQuery.support.cors = true;does not affect success, nor does it set the crossDomain parameter to true or cache false (in an AJAX request).

AJAX dataType, IE? , ; , ( , -, ).

+5
3

ajax , "script" .

, , . , , , IE9.

@dystroy , FF , IE9, script

0

script . .

$(document).ready(function(){
jQuery.support.cors = true;
// call your other functions below.....
})
-2

All Articles