嗨,我有以下代碼:。每個解析JSON返回undefined
$.ajax({'type':'POST', 'url':'https://www.123.com/site/gethistory',
'data':{'a': this.username, 'b': username},
'success':function(history){
alert(history);
var codes = jQuery.parseJSON(history);
$.each(codes, function(key, value) {
alert(key);
}); //each
},
'error':function(){
}
}); //ajax
眼下的關鍵是不確定的。而我試圖提醒(value.text),它仍然給我未定義。
歷史警覺,因爲這:
[{ 「演示」:{ 「文」: 「喜 人」, 「時間」: 「1380167419」}, 「管理員」:{ 「text」:「hi」,「time」:「1380167435」},「demo」:{「text」:「this works flawless now。」,「time」:「1380167436」},文 「:」 我們正在 基本上是與這個工作/」, 「時間」: 「1380167443」}}]
jquey版本用過嗎? –
@ArunPJohny 1.7.1 – jackhao
你打開控制檯並檢查parseJSON是否拋出錯誤? – adeneo