Skip to content

Commit

Permalink
release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
camsong committed Jun 7, 2017
1 parent f121ddc commit 2f18a6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.1.0 / 2017-6-7
==================
* Handle <script> error event, thanks to @michaelvial

1.0.7 / 2017-5-25
==================
* support custom charset on script
Expand Down
6 changes: 6 additions & 0 deletions build/fetch-jsonp.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@
jsonpScript.setAttribute('charset', options.charset);
}
jsonpScript.id = scriptId;
jsonpScript.onerror = function () {
reject(new Error('JSONP request to ' + _url + ' failed'));

clearFunction(callbackFunction);
removeScript(scriptId);
};
document.getElementsByTagName('head')[0].appendChild(jsonpScript);

timeoutId = setTimeout(function () {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fetch-jsonp",
"version": "1.0.7",
"version": "1.1.0",
"description": "Fetch JSONP like a boss using Fetch API",
"main": "build/fetch-jsonp.js",
"scripts": {
Expand Down

0 comments on commit 2f18a6a

Please sign in to comment.