问题描述
JS:functionShowCity(){document.all("Drop_City").options.length=0;varCity=document.all("Drop_Pro").value;vards=System_statistics_AddStock.LoadCity(City).value;if(ds==""){return;}else{if(City!=''){for(vari=0;i<ds.Tables[0].Rows.length;i++){opt=newOption();opt.text=ds.Tables[0].Rows[i].Areaname;opt.value=ds.Tables[0].Rows[i].ID;document.all("Drop_City").add(opt);}ShowArea();}}}functionShowArea(){document.all("Drop_Area").options.length=0;varCity=document.all("Drop_City").value;vards=System_statistics_AddStock.LoadCity(City).value;if(ds=="")return;for(vari=0;i<ds.Tables[0].Rows.length;i++){opt=newOption();opt.text=ds.Tables[0].Rows[i].Areaname;opt.value=ds.Tables[0].Rows[i].ID;document.all("Drop_Area").add(opt);}}HTML:<asp:DropDownListID="Drop_Pro"runat="server"onchange="ShowCity()"Width="85px"></asp:DropDownList><selectid="Drop_City"onchange="ShowArea()"style="width:79px"><optionselected="selected"value="-1">请选择</option></select> <selectid="Drop_Area"style="width:81px"><optionselected="selected"value="-1">请选择</option></select>以上代码在IE6中显示正常在IE7中显示不出来了。。。也没出错提示
解决方案
解决方案二:
降低ie7的安全级别试试
解决方案三:
1:设置一下安全界别2:将站点加到可信任站点中
解决方案四:
是ajax联动把,给一段ie7中可以运行的代码你看看functionLoadStates(countries){varcountryId=document.getElementById("ddlArea").options[document.getElementById("ddlArea").selectedIndex].value;UniShare.XiangSoo.Web.Portal.AjaxMethod.GetStates(countryId,LoadStates_CallBack);}functionLoadStates_CallBack(response){//alert(response.value.Rows.length);if(response.error!=null){alert(response.error);return;}varstates=response.value.Tables[0];if(states==null||typeof(states)!="object"){return;}//alert(statesList);varstatesList=document.getElementById("ddlRegionCode");statesList.options.length=0;for(vari=0;i<states.Rows.length;++i){statesList.options[statesList.options.length]=newOption(states.Rows[i].RegionName,states.Rows[i].RegionCode);}}
解决方案五:
引用2楼Anders_lt的回复:
1:设置一下安全界别2:将站点加到可信任站点中