원격 jsonp.html을보고 Jquery UI 자동로드를 다운로드합니다. ... 내 콘솔에서 모든 요청을 볼 수 있습니다 ...이 아약스 기능입니다하지만 난 콘솔을 열데이터 유형 jsonp와 JSON의 차이
dataType와의 차이점은 무엇이며, "JSONP"및 데이터 유형; "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
}
}));
}
});
},
동일한 도메인 동일한 기원 요청과 다른 도메인에 dataType: json
요청 수단 크로스 도메인 요청에 대한http://jqueryui.com/demos/autocomplete/remote-jsonp.html
'cross-browser' 또는'cross-domain'입니까? : s –
@ 죠이 확실히 크로스 도메인. –
@Joy 덕분에 – thecodeparadox