From 6ef82540a5983399a50e1e69e2663afb001b6b69 Mon Sep 17 00:00:00 2001 From: Ziqiang Li Date: Mon, 20 May 2019 18:51:43 +0800 Subject: [PATCH] bump --- build/index.js | 4 +++- package.json | 2 +- src/index.js | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build/index.js b/build/index.js index 9321804..27ba570 100644 --- a/build/index.js +++ b/build/index.js @@ -76,7 +76,9 @@ function jsonp(url, options) { cleanup(); resolve(data); }; - params[callback] = id; + if (!callbackName) { + params[callback] = id; + } url = handleUrl(url, params); // Create script. script = document.createElement('script'); diff --git a/package.json b/package.json index 068c1ff..48b83cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-jsonp-promise", - "version": "1.0.9", + "version": "1.1.0", "description": "", "main": "build/index.js", "scripts": { diff --git a/src/index.js b/src/index.js index af0c461..afb3b5f 100644 --- a/src/index.js +++ b/src/index.js @@ -26,7 +26,7 @@ function jsonp(url, options) { let timer; let promise; // Generate a unique id for the request. - let id = callbackName || (prefix + (count++)); + let id = callbackName || prefix + count++; function noop() {} @@ -69,7 +69,9 @@ function jsonp(url, options) { cleanup(); resolve(data); }; - params[callback] = id; + if (!callbackName) { + params[callback] = id; + } url = handleUrl(url, params); // Create script. script = document.createElement('script');