diff --git a/js/jquery.js b/js/jquery.js index 1bfc3e3..4f34d75 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -5,18 +5,18 @@ H5P.jQuery = jQuery.noConflict(true); H5P.jQuery.fn.__originalLoad = H5P.jQuery.load; H5P.jQuery.fn.load = function (url, params, callback) { - if (typeof url === "string") { - return H5P.jQuery.fn.__originalLoad.apply(this, arguments); - } - /** * NOTE: * This is needed in order to support old libraries that uses the .load() function * for elements in the deprecated jQuery way (elem.load(fn)), the correct way to do this * now is elem.on('load', fn) */ - console.warn('You are using a deprecated H5P library. Please upgrade!'); - let args = Array.prototype.slice.call(arguments); - args.unshift('load'); - return H5P.jQuery.fn.on.apply(this, args); + if (typeof url === "function") { + console.warn('You are using a deprecated H5P library. Please upgrade!'); + let args = Array.prototype.slice.call(arguments); + args.unshift('load'); + return H5P.jQuery.fn.on.apply(this, args); + } + + return H5P.jQuery.fn.__originalLoad.apply(this, arguments); } \ No newline at end of file