复制代码 代码如下:
<script type="text/javascript">
var language = navigator.browserLanguage?navigator.browserLanguage:navigator.language;
alert(language);
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';
</script>
标签:
js,判断浏览器,语言

免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
狼山资源网 Copyright www.pvsay.com

评论“js 判断浏览器使用的语言示例代码”

暂无“js 判断浏览器使用的语言示例代码”评论...