jQuery-XMPP-plugin
jQuery-XMPP-plugin copied to clipboard
IE XDR Support breaks jQuery AJAX calls with custom dataTypes
$.ajaxTransport code added in the plugin support Microsoft XDR Support #18
is causing problems with $.ajax
with custom ajax return data types like JSON.
For eg;
Whenever jquery.xmpp.js
is included,
$.ajax({
url: 'api.php',
type: "POST",
cache : false,
dataType: "json",
data : {
username : "aaa",
password : "bbb"
},
success : function(response) {
console.log("AJAX Success");
console.log(response);
},
error : function(jqXHR, textStatus, errorThrown) {
console.log("AJAX Error");
console.log(jqXHR);
console.log("Status code: " +jqXHR.status);
console.log(textStatus);
console.log(errorThrown);
}
});
error call back is always executed, and the jqXHR.status
will be 400
even if server responds with
header('HTTP/1.1 200 OK');
Better XDR support script can be found here https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest
Thank you, I will try to see how to fix