Skip to content

Commit 2f18a6a

Browse files
committed
release 1.1.0
1 parent f121ddc commit 2f18a6a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.1.0 / 2017-6-7
2+
==================
3+
* Handle <script> error event, thanks to @michaelvial
4+
15
1.0.7 / 2017-5-25
26
==================
37
* support custom charset on script

build/fetch-jsonp.js

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@
7979
jsonpScript.setAttribute('charset', options.charset);
8080
}
8181
jsonpScript.id = scriptId;
82+
jsonpScript.onerror = function () {
83+
reject(new Error('JSONP request to ' + _url + ' failed'));
84+
85+
clearFunction(callbackFunction);
86+
removeScript(scriptId);
87+
};
8288
document.getElementsByTagName('head')[0].appendChild(jsonpScript);
8389

8490
timeoutId = setTimeout(function () {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fetch-jsonp",
3-
"version": "1.0.7",
3+
"version": "1.1.0",
44
"description": "Fetch JSONP like a boss using Fetch API",
55
"main": "build/fetch-jsonp.js",
66
"scripts": {

0 commit comments

Comments
 (0)