jquery判断PC端还是移动端 //判断在移动设备上 $(function(){ if (navigator.userAgent.match(/mobile/i)) { alert("移动端"); }else{ alert("pc端"); } })