mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-21 01:03:14 +03:00
Merge pull request #144 from acdha/143-xhr-error-handling
Safe cleanup in makeAjaxRequest error handler
This commit is contained in:
commit
f4139cef38
@ -1335,6 +1335,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
if ( options.async ) {
|
||||
/** @ignore */
|
||||
request.onreadystatechange = function() {
|
||||
// 4 = DONE (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties)
|
||||
if ( request.readyState == 4) {
|
||||
request.onreadystatechange = function(){};
|
||||
options.success( request );
|
||||
@ -1352,7 +1353,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
e.message
|
||||
);
|
||||
|
||||
request.onreadystatechange = null;
|
||||
request.onreadystatechange = function(){};
|
||||
request = null;
|
||||
|
||||
if ( options.error && $.isFunction( options.error ) ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user