87,907
社区成员
发帖
与我相关
我的任务
分享
<SCRIPT LANGUAGE="JavaScript">
<!--
function detectBrowser()//Writed by zhong1806#gmail.com at 2007-8-9 15:14:25
{
var sAgent = navigator.userAgent.toLowerCase();
this.isIE = (sAgent.indexOf("msie")!=-1); //IE6.0-7
this.isFF = (sAgent.indexOf("firefox")!=-1);//firefox
this.isSa = (sAgent.indexOf("safari")!=-1);//safari
this.isOp = (sAgent.indexOf("opera")!=-1);//opera
this.isNN = (sAgent.indexOf("netscape")!=-1);//netscape
this.isMa = this.isIE;//marthon
this.isOther = (!this.isIE && !this.isFF && !this.isSa && !this.isOp && !this.isNN && !this.isSa);//unknown Browser
}
var oBrowser = new detectBrowser();
alert("IE:" + oBrowser.isIE + "\nfirefox:" + oBrowser.isFF + "\nsafari:" + oBrowser.isSa + "\nopera:" + oBrowser.isOp + "\nnetscape:" + oBrowser.isNN + "\nmarthon:" + oBrowser.isMa + "\nother browser:" + oBrowser.isOther);
//-->
</SCRIPT>