because axios no longer supports jsonp, I installed the jsonp module, npm i jsonp-- save,
in the way of netizens, and then introduced import jsonp from "jsonp"
in one component. I want to request the link address of another website http://rrrrrrk.tech/data.json
the code is as follows:
methods:{
getList: function () {
jsonp("http://rrrrrrk.tech/data.json", null, (err, data) => {
debugger
if (err) {
console.error(err.message);
} else {
if (data.list.length > 0) {
data.list.map((item) => this.list.push(item))
console.log(data);
}
}
})
}
},
created:function(){
this.getList()
}
the problem now is that the code did not enter the debugger,console and an error was reported. The error is as follows:
I would like to ask if there is something wrong with my code or this link? Why not all external links can be requested? Which god provides an address that can achieve jsonp effect,