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