码迷,mamicode.com
首页 > 编程语言 > 详细

js中二维数组篇

时间:2015-06-16 11:11:26      阅读:140      评论:0      收藏:0      [点我收藏+]

标签:二维数组

QQ:1187362408 欢迎技术交流和学习

js中二维数组篇(二维数组篇):

TODO:

1,一位数组声明并初始化如下:

<span style="color:#000000;">var chkProQuery = new Array("ddlPro", "ddlCity", "ddlCoun", "ddlTown", "ddlVill", "ddlGird");//联动select改变对应checkbox控制全选反选  初始化<省市县乡镇村网格[用户角色类别]
var chkNameArray = new Array("protypechk", "citytypechk", "countypechk", "towntypechk", "villtypechk", "girdtypechk");//初始化数组<省市县乡镇村网格[用户角色类别]名称name></span>

2,二位数组声明并初始化如下:

<span style="color:#000000;">var chkNameIdArray = new Array(["protypechk", "protypechk_"], ["citytypechk", "citytypechk_"], ["countypechk", "countypechk_"], ["towntypechk", "towntypechk_"], ["villtypechk", "villtypechk_"], ["girdtypechk", "girdtypechk_"]);//初始化数组<省市县乡镇村网格[用户角色类别]名称name,i</span>
3,二维数组遍历如下:

<span style="color:#000000;">/*省市县乡镇村网格[用户角色类别]*/
    var typestr = "";
    $.each(chkNameIdArray, function (value, idex) {
        var typeArray = idex;
        var sArray = "";
        $.each(typeArray, function (value, idex) {
            sArray += idex + ",";
        });
        sArray = sArray.substr(0, sArray.length - 1).split(',');
        typestr += RequiredNameIdCheckbox(sArray[0], sArray[1]) + "^";
    });</span>

js中二维数组篇

标签:二维数组

原文地址:http://blog.csdn.net/hr1187362408/article/details/46514241

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!