diff --git a/src/openseadragon.js b/src/openseadragon.js index 2a6e2689..12c11ade 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1313,6 +1313,10 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ makeAjaxRequest: function( url, onSuccess, onError ) { var request = $.createAjaxRequest(); + if (!$.isFunction(onSuccess)) { + throw new Error( "makeAjaxRequest requires a success callback" ); + } + request.onreadystatechange = function() { // 4 = DONE (https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#Properties) if ( request.readyState == 4 ) {