我有一个json响应,我在下面显示使用li并且我将数据保存为doc by data(doc1)的一部分但是当我去表而不是list时我无法保存元素详细信息数据(doc1).help需要请
JSON RESPONSE
{
"Envelope":{
"Body":{
"processResponse":{
"NameList":[
{
"EmpId":"1036",
"Name":"A Gopalan",
"PersonId":"29983"
},
{
"EmpId":"1904",
"Name":"Raghavan, Mr. Gopal",
"PersonId":"28795"
}
],
"client":"http:\/\/xmlns.oracle.com\/InternetMobile\/AbsManagement\/BPELProcessContact",
"xmlns":"http:\/\/xmlns.oracle.com\/InternetMobile\/AbsManagement\/BPELProcessContact"
}
},
if(result.responseJSON.Envelope.Body.processResponse.NameList.length>0)
displayfeed1(result.responseJSON.Envelope.Body.processResponse.NameList);
function displayfeed1(result)
{
var ul="";
var li="";
jQuery('#show1').remove();
ul = $('#mydemo1');
ul.html(null);
for (var i = 0; i <= result.length; i++)
{
var doc1 = result[i];
li = $('<li/>').html(doc1.Name).data(doc1);
li.append($('<br/>'));
li.append($('<hr>'));
ul.append(li);
}
}
<ul id="mydemo1" style="text-align:left;"> </ul>