<script type="text/javascript">
    if(/AppleWebKit.*mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){
    if(window.location.href.indexOf("?mobile")<0){
          try{
                if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
                    window.location.href="/hjb1/hjbwap/";
                }else if(/iPad/i.test(navigator.userAgent)){
                    window.location.href="/hjb1/hjbwap/";
                }else{
                    window.location.href="/hjb1/hjbwap/"
                }
            }catch(e){}
        }
    }
</script>

原理很简单,判断访问者的设备,如果是移动端设备的话就跳转到指定的地址。

Last modification:March 18th, 2019 at 11:49 am
If you think my article is useful to you, please feel free to appreciate