下面的ajax调用抛出错误消息。我无法弄清楚出了什么问题。感谢
$('#filterform input:text[name=other_location]').bind('keyup', function() {
var val = $('#filterform input:text[name=other_location]').val();
$.ajax({
url: 'http://linkedin.com/ta/region?query='+val,
//contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data){
alert('success');
},//success
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("XMLHttpRequest="+XMLHttpRequest.responseText +"\ntextStatus="+textStatus+"\nerrorThrown="+errorThrown);
}
});
});
答案 0 :(得分:3)
您需要的是JSONP
dataType: "jsonp"