[Javascript] ((OT)) Mac Sniffer Script

Muchacho, Laurent (TWIi London) LMuchacho at twii.net
Tue Jan 8 04:26:21 CST 2002


Hi Scott

The this. in the function refer to a properties of this function 
the var bw = new brow() is simply the way of loading the function into your
browser and by that way you create your object called bw like that when that
done you can call your object from everywhere in your page simply by saying 
bw.(on of his properties) and that will return the value you set in the
object 
ex for netscape if you alert (document.layers) in netscape 4 it will return
true and false anywhere else  

function brow(){
this.ns = (document.layers)? true:false;
}
var bw = new brow()

alert(bw.ns)
//return true in netscape 4 and false anywhere else

that mean (document.layers)? true:false; the same as 
if (document.layers){
alert('netscape true')
}else{
alert('netscape false')
}

Hope I'm clear in that description if anything wrong or badly explain please
anyone correct me 

Laurent

-----Original Message-----
From: SnarfLT at aol.com [mailto:SnarfLT at aol.com]
Sent: 07 January 2002 20:45
To: javascript at latech.edu
Subject: Re: [Javascript] ((OT)) Mac Sniffer Script


I'm still relatively new to JavaScript, self-taught of course, so I'm kind
of 
dumbfounded as to what some of the things in the script that Laurent wrote 
are.  for example, what does it do when you put this.ie = (value) what is
the 
"this" referring to?  also what does it do for you when you put  var bw =
new 
brow() also you put bw.(mac/win/etc) in statements, what does that do?  I've

read tutorials and a few books but they never got into this stuff really
well.

I've written scripts in the past where I just couldn't figure out what the 
heck was wrong with them and if I had just asked these questions before
maybe 
I would've been able to make them work.

Thank you,
Scott
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list