摘要: var arr = [ "one", "two", "three", "four"];$.each(arr, function(){ alert(this);});//遍历一位数组//上面这个each输出的结果分别为:one,two,three,fourvar arr1 = [[1, 4, 3], [4, 6, 6], [7, 20, 9]]$.each(arr1, function(i, item){ alert(item[0]);});//遍历二维数组//其实arr1为一个二维数组,item相当于取每一个一维数 阅读全文
posted @ 2012-09-12 10:56 加勒比海盗船 阅读(143) 评论(0) 推荐(0) 编辑