jQuery Ajax does not work on IE8 and IE9

Asked

Viewed 1,331 times

3

I am using Internet Explorer 9 for testing and ajax requests do not work (in all other browsers they work).

I have that code:

$.ajax({
    type: "GET",
    url: "http://cep.correiocontrol.com.br/60441145.json",
    dataType: "json",
    success: function(data) { 
        alert('sucess');
    },
    error: function (request, status, errorThrown) {
        alert(errorThrown);
    } 
});

IE returns "NO TRANSPORT". I searched in forums and saw that the solution was to put, above the script:

jQuery.support.cors = true;

I added but in IE now returns "OBJECT ERROR". Someone has already gone through this?

1 answer

4


You are trying to use CORS, which is a method to allow access to another domain via Ajax. IE only came to support this in the standard way from version 10, and jQuery does not support CORS for IE8 and IE9. You can use a plugin to activate this support, such as this here.

Source: Reply in English in the OS.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.