Skip to content

promise的jsonp,可以为fetch做jsonp的封装。

License

Notifications You must be signed in to change notification settings

AlvinYuXT/jsonp-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

install

npm install jsonp-promise

Useage

import jsonp from jsonp-promise

const url = 'http://xxx.com'

jsonp(url,{method: 'encode'},{jsonp: 'callback', callback: 'render'}).then(res=>{console.log(res)})

Above code will fetch http://xxx.com?method=encode&callback=render

Parameters

  1. url The base url such as: 'http:www.google.com'
  2. params location.search
  3. options

About

promise的jsonp,可以为fetch做jsonp的封装。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published