手机平板等移动端适配跳转URL的js代码

时间:2014-01-25    点击:97   
复制代码 代码如下:

<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="手机页面";
            }else if(/iPad/i.test(navigator.userAgent)){
                window.location.href="平板页面";
            }else{
                window.location.href="其他移动端页面"
            }
        }catch(e){}
    }
}
</script>
用js控制组织结构图可以任意拖拽到指定位置
使用javascript为网页增加夜间模式
jQuery:delegate中select()不起作用的解决方法(实例讲解)
js中的时间转换—毫秒转换成日期时间的示例代码
JS将所有对象s的属性复制给对象r(原生js+jquery)
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved