;(function(v){
window.report_explorer_info=new v();//实例对象
})(function(){
//不可修改的常量
var ieFlag = (navigator.appName === 'Microsoft Internet Explorer') ||
(typeof window.ActiveXObject !== 'undefined') ||
("ActiveXObject" in window) ;//IE检测
this.version = navigator.appVersion;
/**
* 是否为IE浏览器
*/
this.isIe = function (){
return ieFlag;
}
/**
* 浏览器类型和版本信息
*/
this.browser = function(){
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var r={};
var isOpera = userAgent.indexOf("Opera") > -1;
if (isOpera) {
return r.name="Opera",r.code=0,r.version=this.version,r;
}; //判断是否Opera浏览器
if (userAgent.indexOf("Firefox") > -1) {
return r.name="Firefox",r.code=1,r.version=this.version,r;
} //判断是否Firefox浏览器
if (userAgent.indexOf("Chrome") > -1){
return r.name="Chrome",r.code=2,r.version=this.version,r;
}
if (userAgent.indexOf("Safari") > -1) {
return r.name="Safari",r.code=3,r.version=this.version,r;
} //判断是否Safari浏览器
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
return r.name="IE",r.code=4,r.version=this.version,r;
}; //判断是否IE浏览器
}
});