0
我需要根據訪問者的語言更改我的索引。JavaScript重定向到替代索引
我試試這個代碼,但它不工作
<script type="type/javascript">
var language = navigator.language || navigator.browserLanguage;
if (language.indexOf('es') {
window.location = '../index.html';
} else {
window.location = '../index2.html';
}
</script>
你錯過了一個')''中if'聲明 – passion