은 다음 코드 조각 고려하시기 바랍니다 jQuery를 AJAX를 통해 : 내가 JSON 크로스 도메인을 당겨 오전 어떤 이유로 나는 parseerror가 계속콜백 - Parseerror JSONP
$(function() {
$.ajax({
type: "GET",
url: "http://mosaicco.force.com/siteforce/activeretailaccounts",
dataType: "jsonp",
crossDomain: true,
jsonp: "callback",
error: function(jqXHR, textStatus, errorThrown) {
alert('Error Message: '+textStatus);
alert('HTTP Error: '+errorThrown);
},
success: function (data) {
var i = 0;
//Process JSON
$.each(data, function() {
var name = this.locname;
var lat = this.lat;
var lng = this.lng;
var address = this.address;
var address2 = this.address2;
var city = this.city;
var state = this.state;
var postal = this.postal;
var phone = this.phone;
var web = this.web;
web = web.replace("http://", "");
var distance = GeoCodeCalc.CalcDistance(orig_lat, orig_lng, lat, lng, GeoCodeCalc.EarthRadiusInMiles);
//Create the array
locationset[i] = new Array(distance, name, lat, lng, address, address2, city, state, postal, phone, web);
i++;
});
}
});
});
반환 :
HTTP Error:Error: jQuery17209875996995251626_1343943259805 was not called
내가 페이지에서 데이터를 잘 볼 수 있습니다. 콜백은 다음과 같습니다.
callback:jQuery17209875996995251626_1343943259805_:1343943260015
제발 도와주세요 diagno 나가 놓치는 무엇을 se - 감사합니다!
가능한 복제본 [jQuery JSON 응답은 항상 ParseError를 트리거합니다.] (http://stackoverflow.com/questions/5095307/jquery-json-response-always-triggers-a-parseerror) – Bergi