dist/crocodoc.viewer.js
function doXDR(url, method, data, success, fail) {
        var req = support.getXDR();
        try {
            req.open(method, url);
            req.onload = function () { success(req); };
            // NOTE: IE (8/9) requires onerror, ontimeout, and onprogress
            // to be defined when making XDR to https servers
            req.onerror = function () { fail(req); };
            req.ontimeout = function () { fail(req); };
            req.onprogress = function () {};
            req.send(data);
        } catch (e) {
            return fail({
                status: 0,
                statusText: e.message
            });
        }
        return req;
    }
function doXDR(url, method, data, success, fail) {
        var req = support.getXDR();
        try {
            req.open(method, url);
            req.onload = function () { success(req); };
            // NOTE: IE (8/9) requires onerror, ontimeout, and onprogress
            // to be defined when making XDR to https servers
            req.onerror = function () { fail(req); };
            req.ontimeout = function () { fail(req); };
            req.onprogress = function () {};
            req.send(data);
        } catch (e) {
            return fail({
                status: 0,
                statusText: e.message
            });
        }
        return req;
    }
function doXDR ( url , method , data , success , fail ) { var req = support . getXDR ( ) ; try { req . open ( method , url ) ; req . onload = function ( ) { success ( req ) ; } ; // NOTE: IE (8/9) requires onerror, ontimeout, and onprogress // to be defined when making XDR to https servers req . onerror = function ( ) { fail ( req ) ; } ; req . ontimeout = function ( ) { fail ( req ) ; } ; req . onprogress = function ( ) { } ; req . send ( data ) ; } catch ( e ) { return fail ( { status : 0 , statusText : e . message } ) ; } return req ; }
Make an XDR request
@param   {string}   url     request URL
@param   {string}   method  request method
@param   {*}        data    request data to send
@param   {Function} success success callback function
@param   {Function} fail    fail callback function
@returns {XDomainRequest} Request object
@private
Make an XDR request