Jquery设置获取list

            var listItem = "";
            $('#AddTable tr').each(function () {
                    listItem += '{"pkid":"id","Code":"code","Name":"name"},';
            });
            var lists = { "list": "[" + listItem.substring(0, listItem.length - 1) + "]" };

 

          if (lists!= "") {
                    var dataObj = eval("(" + list + ")"); //转换为json对象
                    for (var i = 0; i < dataObj.length; i++) {
                        alert(dataObj[i].pkid);
                    }
                }

posted @ 2017-10-09 18:41  亘古不变  阅读(3439)  评论(0编辑  收藏  举报