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:
Chris Adams 2013-06-26 17:17:50 -04:00
parent 5eccdfee98
commit 1c6a57c710

View File

@ -1321,9 +1321,13 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
if ( request.status == 200 ) {
onSuccess( request );
} else {
$.console.log("AJAX request returned %s: %s", request.status, url);
if ($.isFunction(onError)) {
onError( request );
}
}
}
};
try {
@ -1335,8 +1339,10 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
request.onreadystatechange = function(){};
request = null;
if ($.isFunction(onError)) {
onError( request, e );
}
}
},
/**