<script language=javascript>
alert(window.navigator.systemLanguage);
//得到当前浏览器所使用的语系 IE5.5以上支持
</script>得到语系后再根据相应的值跳转:
zh-tw Chinese(Taiwan Region) zh-cn Chinese(PRC)
en English en-us English(United States)
alert(window.navigator.systemLanguage);
//得到当前浏览器所使用的语系 IE5.5以上支持
</script>得到语系后再根据相应的值跳转:
zh-tw Chinese(Taiwan Region) zh-cn Chinese(PRC)
en English en-us English(United States)
描述内容的语系:<%= Request.ServerVariables("http_accept_language") %>
我应该怎么写。
switch(window.navigator.systemLanguage)
{
case "zh-cn" :
window.location.href = "index1.htm";
break;
case "zh-tw" :
window.location.href = "index2.htm";
break;
case "en-us" :
window.location.href = "index3.htm";
break;
}
</script>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--//
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('en') > -1) document.location.href = 'english.htm';
else if (language.indexOf('nl') > -1) document.location.href = 'dutch.htm';
else if (language.indexOf('fr') > -1) document.location.href = 'french.htm';
else if (language.indexOf('de') > -1) document.location.href = 'german.htm';
else if (language.indexOf('ja') > -1) document.location.href = 'japanese.htm';
else if (language.indexOf('it') > -1) document.location.href = 'italian.htm';
else if (language.indexOf('pt') > -1) document.location.href = 'portuguese.htm';
else if (language.indexOf('es') > -1) document.location.href = 'Spanish.htm';
else if (language.indexOf('sv') > -1) document.location.href = 'swedish.htm';
else if (language.indexOf('zh') > -1) document.location.href = 'chinese.htm';
else
document.location.href = 'english.htm';
// End -->
</script>