2 回答
TA贡献1810条经验 获得超5个赞
正确答案如下。
代码
<script type="text/javascript">
if(location.href.indexOf(localStorage.country) == -1){
location.href = localStorage.country
}
function formChanged(form) {
var val = form.options[form.selectedIndex].value;
if (val !== 'non-value') {
if (localStorage) {
localStorage.country = val;
}
if (!location.href.indexOf(val)) {
location = val;
}
}
}
</script>
<FORM NAME="form1">
<select id="saleTerm" onchange="formChanged(this); location =
this.options[this.selectedIndex].value;" NAME="country" SIZE="1">
<OPTION VALUE="non-value">Select delivery city
<OPTION VALUE="/kategoria-produktu/cadca/">Čadca
<OPTION VALUE="/kategoria-produktu/brno/">Brno
<OPTION id="bratislava" VALUE="/kategoria-produktu/bratislava/">Bratislava
</select>
</FORM>
添加回答
举报