我试图根据选定的类别清单中选择的类别,将数值列入一个子类的选定清单。 似乎还没有在IEE工作。 谁能提出问题?
在S.C.R.C.R.C.R.C.R.C.R.R.C.R.R.R.,I.在I.R.C.R.C.R.C.R.C.R.C.R.R.C.R.R.R.R.R.R.R.R.R.,I.在I.R.C.R.R.C.R.R.R.R.中,I.在I.R.C.R.C.R.R.C.R.R.R.R.R.R.C.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.R.
<body onload="setSubcategories(default_value);">
在小标题档案中,我有类似的东西。
subcategories = new Array();
subcategories[ Lifestyle ] = [ All ,
Beauty (SHC) ,
Skin Care ,
Hair Care ,
Oral Care ,
Cosmetics ,
Footwear ,
Jewelry ,
Male Styling ,
Women Hygiene ,
Womens magazines ,
Apparels ,
Fashion (AFA) ,
Spa ,
Accessories
];
subcategories[ Automobiles ] = [ All ,
Automobiles (C&B) ,
Cars ,
Bikes ,
Car Magazine ,
Bikes Magazine ,
Accessories
];
subcategories[ FoodandBeverage ] = [ All ,
Snacking ,
Confectionary ,
Beverages ,
Generic F&B ,
Restaurant Review ,
Food Reviews ,
Wines & Vineyards
];
function setSubcategories(default_value){
default_value = (typeof default_value == undefined ) ?
All : default_value;
var elem = document.getElementById( id-category );
if(elem == null){return false;}
var category = elem.value;
var subelem = document.getElementById( id-subcategory );
var html = "";
var subcategoriesArr = subcategories[category];
for(var i=0; i < subcategoriesArr.length; i++){
var selected = subcategoriesArr[i] == default_value ? " selected" : "";
html += <option + selected + > + subcategoriesArr[i] + </option>
;
}
subelem.innerHTML = html;
}