pull/1/head
Ziqiang Li 2019-05-20 18:51:43 +08:00
parent 6ce97228a7
commit 6ef82540a5
3 changed files with 8 additions and 4 deletions

View File

@ -76,7 +76,9 @@ function jsonp(url, options) {
cleanup();
resolve(data);
};
if (!callbackName) {
params[callback] = id;
}
url = handleUrl(url, params);
// Create script.
script = document.createElement('script');

View File

@ -1,6 +1,6 @@
{
"name": "simple-jsonp-promise",
"version": "1.0.9",
"version": "1.1.0",
"description": "",
"main": "build/index.js",
"scripts": {

View File

@ -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);
};
if (!callbackName) {
params[callback] = id;
}
url = handleUrl(url, params);
// Create script.
script = document.createElement('script');