¿La solicitud POST de AJAX en IE falla con el error "No Transport"?
Estoy tratando de hacer una solicitud AJAX a un servicio público
Aquí está el código:
$.ajax({
url : "http://api.geonames.org/citiesJSON",
type : 'POST',
cache : false,
dataType : 'json',
data : {
username: "demo",
north:10,
south: 10,
east:10,
west:10}
}).done(function(data) {
alert("Success: " + JSON.stringify(data));
}).fail(function(a, b, c, d) {
alert("Failure: "
+ JSON.stringify(a) + " "
+ JSON.stringify(b) + " "
+ JSON.stringify(c) + " "
+ JSON.stringify(d) );
});
Puedes probarlo en este enlace:http://jsfiddle.net/hDXq3/
La respuesta se recupera con éxito en Chrome y Firefox, y la salida es la siguiente:
Pero para IE, la alerta falla:
Error: {"readyState": 0, "status": 0, "statusText": "No Transport"} "error" "No Transport" undefined
¿Por qué no está funcionando en IE? ¿Y cómo solucionar esto?