npm install jsonp-promise
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
- url The base url such as: 'http:www.google.com'
- params location.search
- options