jquery判断手机端或者pc端

<script>
    $(function(){
        if(navigator.userAgent.match(/mobile/i)) {
            alert('手机')
        }else {
           alert('pc')
        }
    });
</script>

猜你喜欢

转载自www.cnblogs.com/luojie-/p/12505894.html