我在我的视图页面上声明并序列化了数据
@model IEnumerable<MVCvs2012.Models.Employees>
@{
var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var employees = @serializer.Serialize(ViewData["Employees"]);
}
运行浏览器时的结果:
[{"FirstName":"Nancy","LastName":"Davolio","Title":"Sales Representative"}]
我想使用 jquery 将这些数据呈现到这样的表中:
<table id="employee">
<tr>
<td>Nancy</td>
<td>Davolio</td>
<td>Sales Representative</td>
</tr>
...
</table>