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>
添加回答
舉報