0
我正在嘗試在我的網頁中使用ajax做一些事情。但是我的問題在於,我的json結果中有一個數組。我不知道要在jquery
中檢索我的數組中的數據。如何檢索JSON中收到的數組數據
這裏是我的JSON:
{"res":{"tname":"my template","process":["software requirement analysis","efrwefgwerg","ergerger","ewrgerger","erwgrewgre"]}}
我wan't獲得裏面的數據"process"
而我試過是:
var app;
$.each(data.res.process,function(i,data){app='<li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>'+data[i]+'<button aria-hidden="true" data-dismiss="modal" class="proclose close" type="button">×</button></li>';
$('#info .processDet').append(app);});
該代碼給出single
字符從指定index
的index
。我的意思是,如果它是data[0]
那麼它給出s
。如果是那麼它給出f
。
請有人幫我解決這個問題。
可能重複(嵌套)對象,數組或JSON](http://stackoverflow.com/questions/11922383/access-process-nested-objects-arrays-or-json) –
@ Felix Kling如果它是重複的,然後就可以了,經過幾個小時的研究,我在這裏發佈了這個問題。 – james