js判断设备(转)】的更多相关文章

JS判断设备终端(PC,iPad,iPhone,android,winPhone)和浏览器 var ua = navigator.userAgent; var browser = {}, weixin = ua.match(/MicroMessenger\/([^\s]+)/i), webkit = ua.match(/WebKit\/([\d.]+)/i), android = ua.match(/(Android)\s+([\d.]+)/i), ipad = ua.match(/(iPad)…
利用JS判断浏览器的用户代理,从而获得设备类型.利用这个方法可以获得用户的设备是移动设备还是PC设备.     JS代码如下:       function browerType() {         var sUserAgent = navigator.userAgent.toLowerCase();   //浏览器的用户代理设置为小写,再进行匹配         var isIpad = sUserAgent.match(/ipad/i) == "ipad";   //或者利用i…
js移动设备判断方法大全 <!DOCTYPE html> <html> <head> <meta charset="UTF-8" > <title>Insert title here< /title> </head> <body> <script> //js判断是否是苹果设备 function checkIsAppleDevice() { var u = navigator.us…
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>js判断设备类型是移动设备还是PC设备</title> <script type="text/javascript"> // borwserRedirect (function browserRedirect(){ var s…
1.js代码判断当前设备: function deviceType(){ var ua = navigator.userAgent; var agent = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; ; i<len,len = agent.length; i++){ ){ break;…
判断是否是移动设备 var ua = window.navigator.userAgent.toLowerCase(); if(ua.indexOf('mobile')!== -1){ return false; }…
前端开发获取设备信息的代码if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { window.location.href ="https://itunes.apple.com/cn/app/1hao-yao-dian/id727578007?mt=8"; } else if (/(Android)/i.test(navigator.userAgent)) { window.location.href ="http…
var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; if(isAndroid){xxxx }…
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…
function deviceType(){ var ua = navigator.userAgent; var agent = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"]; for(var i=0; i<len,len = agent.length; i++){ if(ua.indexOf…