eg.
var flag={"VenueName":0,"StateList":1,"DMAList":1,"CityList":1,"StreetAdr":0,"ZipCode":0,"ContactName":0,"ContactTitle":0,"ContactEmail":0,"ContactPhone":0,"VenueDesc":0};//new Array(11);
上面数组等价于:
var flag=new Array();
flag["VenueName"]=0;
.....
对于这类数组,其length等于0,所以不能用for(;;)方法来遍历,只能通过for each 方法来遍历这个数组:
对于上面这个数组,其遍历方法为:
for(var p in flag){
alert(P+","+flag[p]);//这里会输出flag的下标和其代表的 值
}