dist/crocodoc.viewer.js
function request() {
                return ajax.request(url, {
                    success: function () {
                        var retryAfter,
                            req;

                        if (!aborted) {
                            req = this.rawRequest;
                            // check status code for 202
                            if (this.status === 202 && util.isFn(req.getResponseHeader)) {
                                // retry the request
                                retryAfter = parseInt(req.getResponseHeader('retry-after'));
                                if (retryAfter > 0) {
                                    setTimeout(request, retryAfter * 1000);
                                    return;
                                }
                            }
                            if (this.responseText) {
                                $deferred.resolve(this.responseText);
                            } else {
                                // the response was empty, so consider this a
                                // failed request
                                retryOrFail({
                                    error: 'empty response',
                                    status: this.status,
                                    resource: url
                                });
                            }
                        }
                    },
                    fail: function () {
                        if (!aborted) {
                            retryOrFail({
                                error: this.statusText,
                                status: this.status,
                                resource: url
                            });
                        }
                    }
                });
            }
function request() {
                return ajax.request(url, {
                    success: function () {
                        var retryAfter,
                            req;

                        if (!aborted) {
                            req = this.rawRequest;
                            // check status code for 202
                            if (this.status === 202 && util.isFn(req.getResponseHeader)) {
                                // retry the request
                                retryAfter = parseInt(req.getResponseHeader('retry-after'));
                                if (retryAfter > 0) {
                                    setTimeout(request, retryAfter * 1000);
                                    return;
                                }
                            }
                            if (this.responseText) {
                                $deferred.resolve(this.responseText);
                            } else {
                                // the response was empty, so consider this a
                                // failed request
                                retryOrFail({
                                    error: 'empty response',
                                    status: this.status,
                                    resource: url
                                });
                            }
                        }
                    },
                    fail: function () {
                        if (!aborted) {
                            retryOrFail({
                                error: this.statusText,
                                status: this.status,
                                resource: url
                            });
                        }
                    }
                });
            }
function request ( ) { return ajax . request ( url , { success : function ( ) { var retryAfter , req ; if ( ! aborted ) { req = this . rawRequest ; // check status code for 202 if ( this . status === 202 && util . isFn ( req . getResponseHeader ) ) { // retry the request retryAfter = parseInt ( req . getResponseHeader ( 'retry-after' ) ) ; if ( retryAfter > 0 ) { setTimeout ( request , retryAfter * 1000 ) ; return ; } } if ( this . responseText ) { $deferred . resolve ( this . responseText ) ; } else { // the response was empty, so consider this a // failed request retryOrFail ( { error : 'empty response' , status : this . status , resource : url } ) ; } } } , fail : function ( ) { if ( ! aborted ) { retryOrFail ( { error : this . statusText , status : this . status , resource : url } ) ; } } } ) ; }
Make an AJAX request for the asset
@returns {XMLHttpRequest|XDomainRequest} Request object
@private
Make an AJAX request for the asset