469,345 Members | 6,175 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,345 developers. It's quick & easy.

explanation of "this"

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?

Feb 27 '07 #1
3 1356
Jason S wrote on 27 feb 2007 in comp.lang.javascript:
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)
Feb 27 '07 #2
On Feb 28, 1:49 am, "Jason S" <jmsa...@gmail.comwrote:
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
>
--
Rob

Feb 27 '07 #3
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...browse_frm/thr...
thanks both of you!

Mar 1 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Michael Stevens | last post: by
1 post views Thread by Shapper | last post: by
7 posts views Thread by relient | last post: by
10 posts views Thread by craig.keightley | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.