Jquery 判断是否 移动设备 浏览
$(document).ready(function() {
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i) ? true : false;
},
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i) ? true : false;
},
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
},
Windows: function() {
return navigator.userAgent.match(/IEMobile/i) ? true : false;
},
any: function() {
return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
}
};
if (isMobile.any()) {
window.location = "xx.html";
//or $('.main_header').hide();
}
else if (isMobile.Android() || isMobile.iOS_Phone()) {
window.location = "aa.html";
}
else {
window.location = "bb.html";
}
});