js判断移动端跳转

<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))){try{if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
    //......
}else if(/iPad/i.test(navigator.userAgent)){}else{}}catch(e){}}</script>
posted @ 2019-10-12 15:04  study_php_java_C++  阅读(420)  评论(0编辑  收藏  举报