var ua = navigator.userAgent.toLowerCase();//获取判断用的对象
if (ua.match(/Mobile/i) == "mobile") {
console.log(ua)
//判断是否是移动设备打开。browser代码在下面

if (ua.match(/MicroMessenger/i) == "micromessenger") {
var warp = document.getElementsByClassName('warp')[0];
warp.style.display = 'block';
} else {
if (ua.match(/Android/i) == "android") {
//是否在安卓浏览器打开
window.location.href = 'http://api.devtool6.com/zhibo/izhibo.apk?hh=' + Math.random();
}
if (ua.match(/iphone/i) == "iphone") {

//是否在IOS浏览器打开
window.location.href = 'https://itunes.apple.com/us/app/i%E6%99%BA%E6%92%AD/id1225212114?mt=8'
}
}