mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 08:36:10 +03:00
makeAjaxRequest: log all errors, test callback
* All AJAX errors will log to the console * The onError callback will only be called if defined
This commit is contained in:
parent
5eccdfee98
commit
1c6a57c710
@ -1321,7 +1321,11 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
if ( request.status == 200 ) {
|
||||
onSuccess( request );
|
||||
} else {
|
||||
onError( request );
|
||||
$.console.log("AJAX request returned %s: %s", request.status, url);
|
||||
|
||||
if ($.isFunction(onError)) {
|
||||
onError( request );
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1335,7 +1339,9 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
request.onreadystatechange = function(){};
|
||||
request = null;
|
||||
|
||||
onError( request, e );
|
||||
if ($.isFunction(onError)) {
|
||||
onError( request, e );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user