我已经搜索了一段时间,无法弄清楚为什么我没有得到 ajax 请求的响应对象:
$(document).ready(function(){
$.ajax({
type: 'GET',
dataType: 'script',
crossDomain: true,
url: 'http://api.netimpact.com/qv1.php?key='+apikey+'&qt=geoip&d=json&q='+userip,
success: function(jqXHR, textStatus) { //both parameters come in as undefined
console.log(jqXHR);
},
error: function(xhr, code){
console.log('error');
}
});
});
响应应该如下所示:
[["Tokyo","Tokyo","Japan","Open Computer Network","35.6850","139.7514","JP"]]