艾Q网

标题: 用jQuery实现pc端与移动端的切换 [打印本页]

作者: admin    时间: 2024-3-10 14:17
标题: 用jQuery实现pc端与移动端的切换
<script type="text/javascript">
    $(function(){
        try {
            var urlhash = window.location.hash;
            if (!urlhash.match("fromapp")){
                //移动端
                if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i))){

                    window.location.href='/cn/index.htm';
                //pc端
                }else{
                    window.location.href='/cn/index.htm';
                }
            }
        }catch(err){}
    });
</script>







欢迎光临 艾Q网 (http://js.iqi123.com/bbs/) Powered by Discuz! X3.4