my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes Basic Javascript question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Basic Javascript question" Watch "Basic Javascript question" New topic
Author

Basic Javascript question

Pavan Kumar Dittakavi
Ranch Hand

Joined: Feb 12, 2011
Posts: 104

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

Joined: Jan 10, 2002
Posts: 61105
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic Javascript question