JS区分移动端和PC

         var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger"
|| ua.match(/iphone os/i) == "iphone os" || ua.match(/ipad/i) == "ipad"
|| ua.match(/android/i) == "android" || ua.match(/midp/i) == "midp"
|| ua.match(/rv:1.2.3.4/i) == "rv:1.2.3.4" || ua.match(/ucweb/i) == "ucweb"
|| ua.match(/windows ce/i) == "windows ce" || ua.match(/windows mobile/i) == "windows mobile") {
alert("移动端"); }
上一篇:java中的xml与实体类之间的映射


下一篇:环境部署(四):Linux下查看JDK安装路径