Connecting Tech Pros Worldwide Forums | Help | Site Map

explanation of "this"

Jason S
Guest
 
Posts: n/a
#1: Feb 27 '07
I have a rough understanding of what the "this" keyword refers to in
Javascript but am not very clear on it. Is there a good reference that
explains it well?


Evertjan.
Guest
 
Posts: n/a
#2: Feb 27 '07

re: explanation of "this"


Jason S wrote on 27 feb 2007 in comp.lang.javascript:
Quote:
I have a rough understanding of what the "this" keyword refers to in
Javascript but am not very clear on it. Is there a good reference that
explains it well?
>
>
Clientside html javascript "this" is a reference in itself,
it references to the object it is called in.

<div onclick='alert(this.id)' id='blah'>clickMe</div>

will show in the alert box the id text 'blah'.

For 'this' reference in prototype/constructor:

<http://www.javascriptkit.com/javatutors/oopjs2.shtml>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
RobG
Guest
 
Posts: n/a
#3: Feb 27 '07

re: explanation of "this"


On Feb 28, 1:49 am, "Jason S" <jmsa...@gmail.comwrote:
Quote:
I have a rough understanding of what the "this" keyword refers to in
Javascript but am not very clear on it. Is there a good reference that
explains it well?
This post by Mike Winter does a pretty good job:

" How do I properly pass a parameter to a parameterized event handler
in a loop"
<URL:
http://groups.google.com.au/group/co...26cd885e01c292
Quote:
>
--
Rob

Jason S
Guest
 
Posts: n/a
#4: Mar 1 '07

re: explanation of "this"


This post by Mike Winter does a pretty good job:
Quote:
>
" How do I properly pass a parameter to a parameterized event handler
in a loop"
<URL:http://groups.google.com.au/group/co...browse_frm/thr...
thanks both of you!

Closed Thread