Tôi tải xuống tự động tải xuống giao diện người dùng Jquery, tìm đến remote-jsonp.html. Đây là chức năng ajax nhưng tôi mở giao diện điều khiển .. Tôi không thể nhìn thấy bất kỳ yêu cầu trong giao diện điều khiển của tôi ...Sự khác biệt giữa dataType jsonp và JSON
chênh lệch giữa datatype là gì; "jsonp" và datatype; "JSON"
$("#city").autocomplete({
source: function(request, response) {
$.ajax({
url: "http://ws.geonames.org/searchJSON",
dataType: "jsonp",
data: {
featureClass: "P",
style: "full",
maxRows: 12,
name_startsWith: request.term
},
success: function(data) {
response($.map(data.geonames, function(item) {
return {
label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
value: item.name
}
}));
}
});
},
Tham chiếuhttp://jqueryui.com/demos/autocomplete/remote-jsonp.html
'cross-browser' hoặc' cross-domain'? : s –
@Joy Chắc chắn là tên miền chéo. –
@Joy cảm ơn cả hai – thecodeparadox