我用这个jQuery的每个函数,并用它迭代我的json数据.
$.each(data.Results,function() {
divs += '<div class="resultsdiv"><br />
<span style="display: inline-block;width:150px;" class="resultName">'
+ this.Mat_Name + '</span><span class="resultfields" style="padding-left:10px;">
Measurement :</span> <span class="resultfieldvalues">'
+ this.Mes_Name + '</span> <a href="/Materials/Delete/' + this.Id + '">
Delete</a> <a href="/Materials/Details/' + this.Id + '">Details</a>
<a href="/Materials/Edit/' + this.Id + '">Edit</a></div>';
});
警报(divs.length);似乎没有得到计数….任何建议…
最佳答案