var brands = new Array(); //创建数组var dates = "1111&2222&3333&4444&5555&6666&7777"; //定义字符串var dtNum = dates.split("&").length; //取得字符串长度brands = dates.split("&"); //为数组负值for (i = 0; i < dtNum; i++) { document.write(brands[i]); //打印数组}