专家,
我有一个.netservice,它返回 json 数据,我使用代码提取了 json 数据
success: function (r) {
var doclist = $.parseJSON(r.d);
console.log(doclist);
我得到了这样的输出
{"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’”
如何阅读此 docId
我正在使用 Visual Studio 2010 和框架 3.5
问候,
Sivajith S.