//判断手机还是pc->true是pc
/*if(Base.isPC()) {
return;
}*/
isPC: function () {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
},
//判断浏览器类型
myBrowser: function(){
var userAgent = navigator.userAgent,
isOpera = userAgent.indexOf("Opera") > -1;
if (isOpera) {
return "Opera";
};
if (userAgent.indexOf("Firefox") > -1) {
return "FF";
}
if (userAgent.indexOf("Chrome") > -1){
return "Chrome";
}
if (userAgent.indexOf("Safari") > -1) {
return "Safari";
}
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
return "IE";
};
},
//判断IE的版本
ieVersion: function(){
var browser = navigator.appName;
var b_version = navigator.appVersion;
var version = b_version.split(";");
var trim_Version = "";
if(!version[1]) return;
trim_Version = version[1].replace(/[ ]/g, "");
if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {
return 6;
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE7.0") {
return 7;
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE8.0") {
return 8;
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE9.0") {
return 9;
}
},
/*if(Base.isPC()) {
return;
}*/
isPC: function () {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
"iPad", "iPod"];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
},
//判断浏览器类型
myBrowser: function(){
var userAgent = navigator.userAgent,
isOpera = userAgent.indexOf("Opera") > -1;
if (isOpera) {
return "Opera";
};
if (userAgent.indexOf("Firefox") > -1) {
return "FF";
}
if (userAgent.indexOf("Chrome") > -1){
return "Chrome";
}
if (userAgent.indexOf("Safari") > -1) {
return "Safari";
}
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
return "IE";
};
},
//判断IE的版本
ieVersion: function(){
var browser = navigator.appName;
var b_version = navigator.appVersion;
var version = b_version.split(";");
var trim_Version = "";
if(!version[1]) return;
trim_Version = version[1].replace(/[ ]/g, "");
if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {
return 6;
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE7.0") {
return 7;
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE8.0") {
return 8;
} else if (browser == "Microsoft Internet Explorer" && trim_Version == "MSIE9.0") {
return 9;
}
},