全屏

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>  <head>   <title> New Document </title>   <meta name="Generator" content="EditPlus">   <meta name="Author" content="">   <meta name="Keywords" content="">   <meta name="Description" content="">  </head>

 <body>   <script>     var browser = {         versions: function() {             var u = navigator.userAgent,                 app = navigator.appVersion;             return { //移动终端浏览器版本信息                 ios: !! u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),                 //ios终端                 android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,                 //android终端或uc浏览器                 iPhone: u.indexOf('iPhone') > -1,                 //是否为iPhone或者QQHD浏览器                 iPad: u.indexOf('iPad') > -1,                 //是否iPad             };         }(),     }     // JavaScript Document     var system ={     win : false,     mac : false,     xll : false     };     //检测平台     var p = navigator.platform;     system.win = p.indexOf("Win") == 0;     system.mac = p.indexOf("Mac") == 0;     system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);     //跳转语句     if(system.win||system.mac||system.xll){          alert("电脑");     }else{          if (browser.versions.iPhone || browser.versions.iPad || browser.versions.ios) {              alert("IOS");         }         if (browser.versions.android) {             alert("android");         }     } </script>  </body> </html>

posted @ 2016-09-22 10:06  mrt_yy  阅读(120)  评论(0编辑  收藏  举报