필자의 방화 광에서 서버가 응답하는 것을 볼 수 있습니다 :parseJSON이 서버의 다음 응답에서 실패하는 이유는 무엇입니까?
{"status":"Results Found","errorcode":"0","result":[{"name":"test","id":"1"},{"name":"some","id":"2"}]}
When I do the following I get a "o is null" error.
$.ajax({
type: "get",
url: "http://someurl",
data: $("#eventsearch").serialize(),
dataType: 'json',
success: function(msg){
var o = $.parseJSON(msg); //o is NULL error
}
그러나 같은 문자열에 parseURL을했을 때 서버 응답이 아닐 때 모든 것이 좋습니다. 여기서 무슨 일이 일어나고있는거야?
var t = '{"status":"Results Found","errorcode":"0","result":[{"name":"test","id":"1"},{"name":"some","id":"2"}]}';
var o = $.parseJSON(t); //everything is good here