mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-26 07:06:10 +03:00
makeAjaxRequest: throw error for missing callback
This commit is contained in:
parent
1c6a57c710
commit
db38b71dd9
@ -1313,6 +1313,10 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
makeAjaxRequest: function( url, onSuccess, onError ) {
|
makeAjaxRequest: function( url, onSuccess, onError ) {
|
||||||
var request = $.createAjaxRequest();
|
var request = $.createAjaxRequest();
|
||||||
|
|
||||||
|
if (!$.isFunction(onSuccess)) {
|
||||||
|
throw new Error( "makeAjaxRequest requires a success callback" );
|
||||||
|
}
|
||||||
|
|
||||||
request.onreadystatechange = function() {
|
request.onreadystatechange = function() {
|
||||||
// 4 = DONE (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties)
|
// 4 = DONE (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties)
|
||||||
if ( request.readyState == 4 ) {
|
if ( request.readyState == 4 ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user