^h專家,JSON數據提取不workinggood
我有returs JSON數據.netservice和我使用的代碼
success: function (r) {
var doclist = $.parseJSON(r.d);
console.log(doclist);
我得到了出來把這樣
提取的JSON數據{"status":{"status":"success","userid":"1"},"data":{"docId":9,"doc_name":"Array","file_name":"Admin/ch6_macro_processors.pdf","owneruser":1,"cat_id":1,"desctiption":"jkkkl","comments":"fghh","dept_id":1,"contype":"application/pdf","size":0,"rvwFlg":"application/pdf","right":"R"},"data":{"docId":10,"doc_name":"Image","file_name":"Admin/545765_427770260634015_1210695556_n.jpg","owneruser":1,"cat_id":1,"desctiption":"control so users can upload files on the site that i've built. The location I'm attempting to save t","comments":"control so users can upload files on the site that i've built. The location I'm attempting to save t","dept_id":1,"contype":"image/jpeg","size":127,"rvwFlg":"image/jpeg","right":"R"},"data":{"docId":9,"doc_name":"Array","file_name":"Admin/ch6_macro_processors.pdf","owneruser":1,"cat_id":1,"desctiption":"jkkkl","comments":"fghh","dept_id":1,"contype":"application/pdf","size":0,"rvwFlg":"application/pdf","right":"U"}}
但
console.log(doclist.data["docId"]); retuns error
「遺漏的類型錯誤:無法讀取屬性 'DOCID' 的未定義」
如何O讀此的docId
我使用Visual Studio 2010和工作框架3.5
問候,
Sivajith秒。
您發佈的輸出是什麼? Web服務調用的結果或「r.d」的值?您發佈的內容中沒有包裝「d」屬性。 –
我提到它的「doclist」 – Sivajith