Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic Javascript question

 
Pavan Kumar Dittakavi
Ranch Hand
Posts: 106
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can someone please tell me what the following statments mean? Im totally confused



I know that these are basic js questions. But Im really not able to comprehend these things here. Im very much new to js . Please suggest.

Thanks,
Pavan.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. No the function is not called by this statement. Functions are first class objects in JavaScript so references to them can be passed around. Here, the actionCall property is being assigned as a reference to the function.

2. tbody sounds like it's a reference to a tbody element, so this is simply traversing the DOM tree. (Would be lots and lots easier using jQuery.)

3. Yes.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tbody.firstChild.lastChild.firstChild

Start with a tbody element
first child of the tbody would be the first tr element
last child of the tr would be the last cell [td or th]of the table
first child of the cell would be the first element in it.

Eric

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic