<script type="text/javascript"> var system ={}; var p = navigator.platform; //判断是否为PC system.win = p.indexOf("Win") == 0; system.mac = p.indexOf("Mac") == 0; system.x11 = (p == "X11") || (p.indexOf("Linux…
//平台.设备和操作系统 var system ={ win : false, mac : false, xll : false }; //检测平台 var p = navigator.platform; system.win = p.indexOf(; system.mac = p.indexOf(; system.x11 = (p == ); //跳转语句 if(system.win||system.mac||system.xll){ alert("PC访问"); }else{ a…
js判断客户端是否是IOS或者是Android //如果返回true 则说明是Android function is_weixin() { var ua = window.navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == 'micromessenger') { return true; } else { return false; } } js判断手机操作系统(ios或者是Android) $(functi…
JS判断浏览器类型 function judge(){ var browser = { versions: function() { var u = navigator.userAgent, app = navigator.appVersion; return {//移动终端浏览器版本信息 trident: u.indexOf(, //IE内核 presto: u.indexOf(, //opera内核 webKit: u.indexOf(, //苹果.谷歌内核 gecko: u.indexOf…
一 .   js判断移动端的操作系统(ios或Android) $(function () { var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端 if (isAndroid) { //这个是安卓操作系统 } if (isI…
// 判断是否为隐藏(css)样式 function isHide(obj) {   var ret = obj.style.display === "none" || obj.style.display === "" || (obj.currentStyle && obj.currentStyle === "none") || (window.getComputedStyle && window.getCompu…
function getDefaultImg() { //添加判断图片是否存在操作 var $defaultImgPathObj = $('input[name=defaultImgPath]'); ) { var nopic = $defaultImgPathObj.val(); $("img").each(function(){ var img = $(this); ){ $(this).attr("src", nopic); }else{ $(img).err…
function validataOS(){ if(navigator.userAgent.indexOf(“Window”)>0){ return ”Windows”; }else if(navigator.userAgent.indexOf(“Mac OS X”)>0) { return ”Mac ”; }else if(navigator.userAgent.indexOf(“Linux”)>0) { return ”Linux”; }else{ return ”NUll”; }…
还是利用UA, 返回值: ios, android, unknown function getMobileType () { var ua = window.navigator.userAgent.toLowerCase() if (/iphone|ipad|ipod/.test(ua)) { return 'ios' } else if (/android|adr|linux/.test(ua)) { return 'android' } return 'unknown' }…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Typ…