By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

Question about JavaScript closure (while attaching an event handler)

dmjpro
100+
P: 2,476
I am adding a table inside a TD
Expand|Select|Wrap|Line Numbers
  1. function addTable(){
  2. td_ref = ....
  3. table_ref =......
  4. table_tr_ref = ....
  5. table_ref.appendChild(table_tr_ref );
  6. a_button_ref = ....
  7. ...
  8. ....
  9. a_button_ref.onclick = function(){another_handler(this);}
  10. table_tr_ref.appendChild(a_button_ref);
  11. ...
  12. td_ref.appendChild(table_ref);
  13. }
  14.  
Now tell me experts what bold this refers to ?
Please clarify..actually what happens ..it refes to teh current object..means the Button.
Feb 11 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027

dmjpro
100+
P: 2,476
Thanks for your help.
But Acoder tell me one thing so suitable link ..how can you get and how can you remember ... did you bookmark those links ? :P
Feb 11 '09 #3

acoder
Expert Mod 15k+
P: 16,027
It's just a case of searching well, and with quite a lot of similar questions, it's the same links (some bookmarked, some stay in the head).

Oh, and you're welcome.
Feb 11 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.