主题:  这些代码如何应用?

Liuying

职务:普通成员
等级:2
金币:1.0
发贴:303
注册:2002/4/13 2:22:40
#12004/7/29 15:10:16
function BrowserCheck(){

	this.NavName = navigator.appName;
	this.NavAnt = navigator.userAgent;
	this.NavVer = navigator.appVersion;
	this.NavPlug = navigator.plugins;
	this.NavVsub = navigator.vendorSub;
	this.NavVerI = parseInt(this.NavVer);
	this.NavVerF = parseFloat(this.NavVer);
	
	this.NN = (this.NavName == "Netscape")
	this.NN4 = (this.NavAnt.indexOf("Mozilla/4") != -1);
	this.NN6 = (this.NavAnt.indexOf("Netscape6/") != -1);
	this.NN7 = (this.NavAnt.indexOf("Netscape/7") != -1);
		
	this.IE = (this.NavName == "Microsoft Internet Explorer");
	this.IE3 = (this.NavAnt.indexOf('MSIE 3')>0);
	this.IE45 = (this.NavVer.indexOf('MSIE 4.5')>0);
	this.IE401 = (this.NavVer.indexOf('MSIE 4.01')>0);
	this.IE4 = (this.NavVer.indexOf('MSIE 4')>0);
	this.IE51 = (this.NavAnt.indexOf('MSIE 5.1')>0);
	this.IE52 = (this.NavAnt.indexOf('MSIE 5.2')>0);
	this.IE5 = (this.NavVer.indexOf('MSIE 5')>0);		
	this.IE6 = (this.NavVer.indexOf('MSIE 6')>0);

	this.GEK = (this.NavAnt.indexOf("Gecko") != -1);
	this.SAF = (this.NavAnt.indexOf("Safari",0) != -1);
	this.CAB = (this.NavAnt.indexOf("iCab",0) != -1);
	this.OPE = (this.NavAnt.indexOf("Opera",0) != -1);

	this.Win = (this.NavAnt.indexOf("Win",0) != -1);
	this.XP = (this.NavAnt.match(/NT 5\.1|XP/));
	this.ME = (this.NavAnt.match(/4\.90|ME/));
	this.TK = (this.NavAnt.match(/NT 5\.0|2000/));
	this.NT = (this.NavAnt.match(/NT 5\.0|WinNT/));

	this.Mac = (this.NavAnt.indexOf("Mac",0) != -1);
	this.M68k = (this.NavAnt.indexOf("68k",0)!=-1);

	this.Uix = (this.NavAnt.indexOf("X11",0) != -1);
	this.EGB = (this.NavAnt.indexOf("Planetweb",0) != -1);

}

var checkB = new BrowserCheck();



浮尘

职务:普通成员
等级:3
金币:7.0
发贴:1258
注册:2001/11/19 12:41:09
#22004/7/29 16:48:08
这是建立了一个对象呀,怎么还问如何应用?
var checkB=new BrowserCheck();
document.write(checkB.NavName);