判断手机电脑微信 js

if ((navigator.userAgent.match(/(MicroMessenger)/i))) {
        //微信浏览器
        //location.href="";

    } else if ((navigator.userAgent.match(/(iPhone|iPod|ios|iPad)/i))) {
        //苹果设备
        // location.href="";

    } else if ((navigator.userAgent.match(/(Android)/i))) {
        //安卓设备
        //location.href="";
} else { //其他设备,如电脑端 //location.href=""; }

 

posted @ 2016-06-22 10:57  Ali.Blacken  阅读(171)  评论(0编辑  收藏  举报