网站首页/技术开发列表/内容

自动根据语言系统跳转页面

技术开发2022-07-21阅读

    自动根据浏览者的语言系统跳转相应的页面
    代码如下:

    <script language="JavaScript">
    <!--
    var la=navigator.browserLanguage.toLowerCase(); //识别系统语言
    if(la=='zh-cn') document.location = 'http://www.xxx.com'; //如果是简体中文
    else if(la=='zh-tw') document.location = 'http://BG5.xxx.com'; //如果繁体中文
    else document.location = 'http://EN.xxxx.com'; //如果都不是
    // -->
    </script>

……

相关阅读