JSFiddle - React, Tailwind, and code Playground
by jaubourg
JavaScript
if ( jQuery.ajaxPrefilter ) {
jQuery.ajaxPrefilter(function( options, _, jqXHR ) {
var oldXHRFN = options.xhr,
xhr;
options.xhr = function() {
return xhr = oldXHRFN.apply( this, arguments );
};
jqXHR.complete(function() {
console.log( "jqXHR.status: " + jqXHR.status );
console.log( "jqXHR.statusText: " + jqXHR.statusText );
console.log( "xhr.status: " + xhr.status );
console.log( "xhr.statusText: " + xhr.statusText );
});
});
} else {
jQuery.ajaxSetup({
complete: function( xhr ) {
console.log( "xhr.status: " + xhr.status );
console.log( "xhr.statusText: " + xhr.statusText );
}
});
}