javascript - vue uses native jsonp, how to make the jsonp returned in the background call the callback function?
学习ing
学习ing 2017-07-05 10:42:18
0
3
910

It’s like this, I use the native jsonp in vue, and then the jsonp returned in the background cannot always be called when calling callback! The following is part of my source code.

https://codepen.io/1206189299...
Error report:
Please ignore the packaging error

学习ing
学习ing

reply all(3)
过去多啦不再A梦

window.getData=function (data){
xxx logic
}

给我你的怀抱

Obviously Vue has its own namespace, if you don’t use it explicitly

window.yourCallbackFunction=function(data){
//处理 data
}

Defining the global function in this way, jsonp obviously cannot successfully call the callback function.

三叔

To handle cross-domain requests, you can use webpack to configure the proxy to forward the request or use the node proxy service to forward the request

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template