我想获得此URL的响应。但是当我检查控制台出现错误信息时:未捕获的类型错误:响应不是函数
Uncaught TypeError: response is not a function
可能出现什么问题?
var uri = pbxApi+"/conference/participants/"+circle+"/"+data.conference+"/"+data.uniqueid+'?jsonp=response';
getJsonData(uri, function(res){
});
这是我的功能。
var getJsonData = function(uri,callback){
$.ajax({
type: "GET",
dataType: "jsonp",
url: uri,
jsonpCallback: 'response',
cache: false,
contentType: "application/json",
success: function(json){
callback(json);
}
});
}
这是我的回应:
response({"_id":"56177d3b3f2dc8146bd8565c","event":"ConfbridgeJoin","channel":"SIP/192.168.236.15-0000005e","uniqueid":"1444379955.224","conference":"0090000293","calleridnum":"0090000290","calleridname":"0090000290","__v":0,"status":false,"sipSetting":{"accountcode":"0302150000","accountcode_naisen":"203","extentype":0,"extenrealname":"UID3","name":"0090000290","secret":"Myojyo42_f","username":"0090000290","context":"innercall_xdigit","gid":101,"cid":"0090000018"}})
检查这一项http://stackoverflow.com/questions/32450690/show-some-error-uncaught-referenceerror – guradio
我已经声明'jsonpCallback得到了回报数据:'响应','在我的代码上。 – uno
只需提一下,'success:function(json){callback(json);如果我使用这个'success:callback(json)'而不是这个'success:function(json){callback(json);},则可以简单地使用'success:callback(json)' –