大家好,下面是我的代码
$.ajax({
'url': 'myUrl',
'dataType': 'jsonp',
crossDomain: true,
'data': {
// sample daa
},
'success': function (data) {
alert("here::");
},
'error': function (jqxhr, status, errorThrown) {
alert("Failure, Unable to recieve content : " + status)
alert(jqxhr.responseText);
})
})
我正在使用 jsonp,因为我的 url 属于其他域,并且我能够将响应代码设为 200,并且我可以看到响应中的数据(在 Firebug 中检查),但没有一个成功或错误方法正在执行。
请帮助我
更新响应(从萤火虫复制)
{"documents":[{"trans":"sdsd","orig":"How","translit":"Elā","src_translit":""}],"dict":[{"pos":"unknown","terms":["dgssdg","sgsd"],"entry":[{"word":"gsdg","reverse_translation":["method","treatment","recipe","attitude","how","retro"],"score":0.000305442198},{"word":"మార్గము","reverse_translation":["way","route","road","entry","how","impasse"],"score":0.000305442198}],"base_form":"how","pos_enum":20}],"src":"en","server_time":12}