【文件属性】:
文件名称:jsonp-good:一个用jsonp发送跨域请求的模块,返回一个Promise对象
文件大小:108KB
文件格式:ZIP
更新时间:2021-03-09 08:52:14
TypeScript
jsonp好
一个用jsonp发送跨域请求的模块,返回一个Promise对象。
安装
$ npm install jsonp - good
参数说明
jsonpG ( {
url : 'http://xxxx/xxxx/' ,
funcName : 'fake' ,
timeout : 3000 ,
params : {
a : '1' ,
b : '2'
}
} )
. then ( res => console . log ( res ) )
. catch ( e => console . log ( e ) )
url :必选参数!!!请求的完整地址
funcName :必选参数!!!多个函数的名字,随便叫什么都可以,总之必须要写,而且要保证该名字是唯一的
timeout :可选参数,超时时间设置,单位是ms,默认值6000
para
【文件预览】:
jsonp-good-master
----src()
--------jsonp-good.ts(505B)
--------core()
--------helpers()
--------types()
----code-of-conduct.md(3KB)
----release.sh(477B)
----CONTRIBUTING.md(936B)
----.travis.yml(563B)
----tsconfig.json(483B)
----LICENSE(1KB)
----tools()
--------gh-pages-publish.ts(898B)
--------semantic-release-prepare.ts(1KB)
----test()
--------test.js(869B)
--------helpers()
----rollup.config.ts(1KB)
----tslint.json(81B)
----README.md(2KB)
----.editorconfig(211B)
----.gitignore(115B)
----package-lock.json(539KB)
----package.json(3KB)