最近在做移动端网站,也需兼容PC端.还没找到更好的方法,只能用javascr判断用户是在PC端打开还是移动端打开. JS判断 var isPC = function (){ var userAgentInfo = navigator.userAgent.toLowerCase(); var Agents = new Array("android", "iphone", "symbianOS", "windows phone&
1.方法一 function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = true; for (var v = 0; v < Agents.l
<script type="text/javascript">(function() { //得到域名后缀 var path = location.pathname.split('/') path = path.pop(); var ua = navigator.userAgent.toLowerCase(); var bIsIpad = ua.match(/ipad/i) == "ipad"; var bIsIphoneOs = ua.match(/i
function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v < Agent
<script type="text/javascript"> function is_mobile(){ var regex_match=/(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsourc
var checkBrowser; 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 = sUserA
function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; var flag = true; ; v < Agents.length; v++) { ) { fl
方法一: var isPC = function () { var userAgentInfo = navigator.userAgent.toLowerCase(); var Agents = new Array("android", "iphone", "symbianOS", "windows phone", "ipad", "ipod"); var flag = true; fo