diff --git a/index.js b/index.js index 1ee62b3..8daaf09 100644 --- a/index.js +++ b/index.js @@ -91,6 +91,9 @@ function jsonp(url, opts, fn){ // create script script = document.createElement('script'); script.src = url; + jsonpScript.addEventListener('error',function(event){ + window[id](event); + }); target.parentNode.insertBefore(script, target); return cancel;