首页 > Web开发 > 详细

Jquery设置获取list

时间:2017-10-09 19:25:13      阅读:276      评论:0      收藏:0      [点我收藏+]

            var listItem = "";
            $(‘#AddTable tr‘).each(function () {
                if ($.trim($(this).children("td:eq(0)").text()) == "移除") {
                    var pkid = $.trim($(this).children("td:eq(0)").children("#BusinessCategoryId").val());
                    var EntireCategoryCode = $.trim($(this).children("td:eq(1)").text());
                    var BizCategoryName = $.trim($(this).children("td:eq(2)").text());
                    var RiskLevelId = $.trim($(this).children("td:eq(3)").text());
                    listItem += ‘{"pkid":"‘ + pkid + ‘","Code":"‘ + EntireCategoryCode + ‘","Name":"‘ + BizCategoryName + ‘","RiskLevelId":"‘ + RiskLevelId + ‘",},‘;
                }
            });
            var lists = { "list": "[" + listItem.substring(0, listItem.length - 1) + "]" };

            parent.global = lists

 

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

Jquery设置获取list

原文:http://www.cnblogs.com/ment/p/7642468.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!