//浏览器监测
(function(){
window.sys = {}; //外部访问浏览器信息对象;
var ua = navigator.userAgent.toLowerCase(); //浏览器信息字符串
var s; //浏览器名称加版本
(s = ua.match(/msie ([\d.]+)/)) ? sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? sys.chrome = s[1] :
(s = ua.match(/opera\/.*version\/([\d.]+)/)) ? sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? sys.safari = s[1] : 0 ;
})();
if(sys.chrome){
alert('这是a浏览器');
};
if((/msie ([\d.]+)/).test(ua)){
s = ua.match(/msie ([\d.]+)/);
sys.ie = s[1];
}
if((/firefox\/([\d.]+)/).test(ua)){
s = ua.match(/firefox\/([\d.]+)/);
sys.firebox = s[1];
}
if((/chrome\/([\d.]+)/).test(ua)){
s = ua.match(/chrome\/([\d.]+)/);
sys.chrome = s[1];
}
if((/opera\/.*version\/([\d.]+)/).test(ua)){
s = ua.match(/opera\/.*version\/([\d.]+)/);
sys.opera = s[1];
}
if((/version\/([\d.]+).*safari/).test(ua)){
s = ua.match(/version\/([\d.]+).*safari/);
sys.safari = s[1];
}