这是我的 Json 对象示例:
{"UserName":Mike,"IsActive":0,"ChbxIsActive":false,"MyAccountsAvailable":[{"Id":"157A","MyAccount":"CHRIS MCEL","MyCheckBox":false,"Tags":null},{"Id":"157B","MyAccount":"DAN BONE","MyCheckBox":false,"Tags":null}
这是我对部分对象的尝试:
$.getJSON('/ManageUsers/GetCheckBoxesJson', { clientId: clientId, user: user }, function (data) {
var items = [];
$.each(data, function (key, val) {
alert(key + " " + val);
});
当然,我成功地从对象的属性中获取数据,除了不确定如何迭代数组。我得到 [Object, Object] 如果有人可以展示一个很棒的样本。