使用如下代码实现中英文网页切换。
<script>
<!--
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('zh-cn') > -1) document.location.href = 'http://www.williamlong.info/';
else if (language.indexOf('en') > -1) document.location.href = 'http://www.williamlong.info/index.htm';
else
document.location.href = 'http://www.williamlong.info/';
//-->
</script>
转载自月光博客 [ http://www.williamlong.info/ ] |