在网页的顶部加入javascript判断代码: function checkserAgent(){ var userAgentInfo=navigator.userAgent; var userAgentKeywords=newArray("Android", "iPhone" ,"SymbianOS", "Windows Phone", "iPad", "iPod", "MQ…
function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserAgent.match(/midp/i…
<scripttype="text/javascript"> function browserRedirect() { var sUserAgent= navigator.userAgent.toLowerCase(); var bIsIpad= sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs= sUserAgent.match(/iphone os/i) == "iphone os&q…
第一种,只区分浏览器,不考虑版本 function myBrowser(){ var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isOpera = userAgent.indexOf("Opera") > -1; if (isOpera){return "Opera"}; //判断是否Opera浏览器 if (userAgent.indexOf("Firefox")…
在手机端应用的开发中,经常会碰到IOS系统跟Android系统去访问同一个内容时的展示效果不同,这时候我们需要区别对待,下面代码就是用js判断手机终端是否IOS系统: //判断是否为ios系统:是IOS:true,不是:false. function isIOS(){ var u = navigator.userAgent; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 return isiOS; }…