标签:二维数组
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>
标签:二维数组
原文地址:http://blog.csdn.net/hr1187362408/article/details/46514241