Reputation: 544
I have this call:
$.ajax({dataType: "json",
url: '<url_here>',
cache: false,
success: function(data, textStatus, jqXHR ) {
success(data, textStatus, jqXHR);
}
});
That works on every browser ou there... except on IE :( (I'm testing version 8) The success function is never called so it looks like the function (.ajax) isn't executed right (or at all). Anyone know anything about jquery ajax on ie 8?
Upvotes: 3
Views: 3744
Reputation: 544
OK, this ones are always good, where one answer to himself :)
The problem was that looks like IE doesn't parse the headers from the ajax'ed site. So as this was a cross domain request, it was allowing it to get through. So, I had to activate "Access data sources across domain" on IE security settings. On other browsers, just adding the header Access-Control-Allow-Origin: * would allow for cross site scripting, just not on IE.
One other thing I had to add to the script was: jQuery.support.cors = true;
or I would get "No transport available"
Upvotes: 4
Reputation: 9167
This is because, my default, IE8 doesn't support JSON. You need to include the json2 library in your project.
Upvotes: 0