我在chrome扩展(内容脚本)中发出JSONP请求.当我作为网页运行 - 在我的浏览器中加载HTML文件时,一切都运行良好,但是当我将其作为chrome扩展加载时,当服务器给出响应时,jquery创建的jsonp回调函数似乎不存在.
我的控制台说:
Uncaught ReferenceError: jQuery17105683612572029233_1323808231542 is not defined
Run Code Online (Sandbox Code Playgroud)
这是我的ajax请求:
$.ajax({
url: 'http://example.com',
data:
{
imgUrl: this.href,
returnString:true
},
dataType: "jsonp",
success: function(msg){
newNode.src = msg.data;
},
error: function(msg){
console.log(msg.data);
}
})
Run Code Online (Sandbox Code Playgroud)