<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head xmlns="">
<title></title>
<script>
function fun(){
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
if (window.ActiveXObject)//IE
Sys.ie = ua.match(/msie ([/d.]+)/)[1]
else if (document.getBoxObjectFor) //火狐
Sys.firefox = ua.match(/firefox//([/d.]+)/)[1]
else if (window.MessageEvent && !document.getBoxObjectFor)//谷歌
Sys.chrome = ua.match(/chrome//([/d.]+)/)[1]
else if (window.opera)//Opera
Sys.opera = ua.match(/opera.([/d.]+)/)[1]
else if (window.openDatabase)//菜果
Sys.safari = ua.match(/version//([/d.]+)/)[1];
alert(Sys.ie);//可判断浏览器版本
}
</script>
</head>
<body οnlοad="fun();">
</body>
</html>