JSFiddle - React, Tailwind, and code Playground

by mastamm

HTML

<button id="btnTest">test</button>

JavaScript

(function( jQuery ) {

if ( window.XDomainRequest ) {
    alert("window.XDomainRequest");

    jQuery.ajaxTransport(function( s ) {
        alert("jQuery.ajaxTransport");

        if ( s.crossDomain && s.async ) {
            alert("s.crossDomain && s.async");

            if ( s.timeout ) {
                s.xdrTimeout = s.timeout;
                delete s.timeout;
            }
            var xdr;
            return {
                send: function( _, complete ) {
                    function callback( status, statusText, responses, responseHeaders ) {
                        //xdr.onload = xdr.onerror = xdr.ontimeout = jQuery.noop;
                        xdr.onload = xdr.onerror = xdr.ontimeout = xdr.onprogress = jQuery.noop;    //new
                        xdr = undefined;
                        complete( status, statusText, responses, responseHeaders );
                    }
                    xdr = new XDomainRequest();
                    xdr.open( s.type, s.url );
                    xdr.onload = function() {
                        callback( 200, "OK", { text: xdr.responseText }, "Content-Type: " + xdr.contentType );
                    };
                    xdr.onerror = function() {
                        callback( 404, "Not Found" );
                    };
                    xdr.onprogress = function() {};    //new
                    if ( s.xdrTimeout ) {
                        xdr.ontimeout = function() {
                            callback( 0, "timeout" );
                        };
                        xdr.timeout = s.xdrTimeout;
                    }
                    xdr.send( ( s.hasContent && s.data ) || null );
                },
                abort: function() {
                    if ( xdr ) {
                        xdr.onerror = jQuery.noop();
                        xdr.abort();
                    }
                }
            };
        }
    });
}
})( jQuery );


$("#btnTest").click(function() {


var url=...