응답에 200 개의 성공 코드와 parseerror를 반환하는 jQuery AJAX 호출에 오류가 발생했습니다. 나는 이것이 jQuery가 데이터를 얻었지만 그것을 파싱 할 수 없다는 것을 의미한다고 가정하고있다. 그러나 응답 데이터를 검색 할 수 있으며 올바른 형식의 JSON입니다.AJAX가 200 회 성공했지만 응답을 구문 분석하지 못했습니다. JSON
크로스 도메인 서비스를 위해 jsonp 데이터를 사용하고 있습니다.
jQuery를
jQuery.ajax({
url: ServiceBasePath + "/json/ZipRiders",
dataType: "jsonp",
success: function (data) {
...
},
error: function (a,b,c) {
alert(a, b, c);
}
});
오류 데이터
a: Object { readyState=4, status=200, statusText="success", more...}
b: "parsererror"
c: Error: jQuery1101020726428059127155_1377610175566 was not called
응답
[
{
"AdDescription": "Taking 75 north instead of 23 just for fun",
"AdID": "---",
"CityName": "Highland",
"IsWanted": false,
"Latitude": "42.656281",
"Longitude": "-83.63297",
"Name": "Ride to Milford, MI",
"NetworkLogon": "---",
"RideNotifyEnable": true,
"UserName": "---"
},
{
"AdDescription": "Ride to jackson",
"AdID": "---",
"CityName": "Jackson",
"IsWanted": false,
"Latitude": "42.252268",
"Longitude": "-84.38842",
"Name": "Ride to Jackson, MI",
"NetworkLogon": "---",
"RideNotifyEnable": true,
"UserName": "---"
},
{
...
},
{
...
},
...
]
나는 $ .parseJSON()을 사용하여 JSON 객체로 만들어야한다고 생각한다. –
전체 json 데이터를 볼 수 있습니까 –
''jsonp "'를 지정하고 있지만 JSON을 반환하고 있습니다. 그것들은 같은 것이 아닙니다. http://stackoverflow.com/questions/3839966/can-anyone-explain-what-jsonp-is-in-layman-terms/3840118#3840118 – Ian