marleneayers (3) [Avatar] Offline
#1
I am a new reader to jQuery in Action and also stumbled on section 3.1. I want to make sure I understand this before I continue. This is my interpretation of the online discussion from July 22

A browser starts to interpret the HTML page. Browser comes across the image tag. A Javascript object is created which is also called a Dom Element. The browser gathers all the html tag attributes (src, alt, title) and creates a NodeList object which is a property of the Javascript Object. AT THE SAME time the browser creates properties directly on the Javascript object which correspond (for the most part) to the attributes on the html tag?).

Here is the part for the book I do not understand yet
This element markup is read and interpreted by the browser to create the Javascript object that represents this element in the DOM. In addition to storing the attributes, this object possesses a number of peropertiesm including some that represent the values of the markup attributes. This sentence totally confused me.

Also in the next paragraph when we refer to attribute properties, are we referrinf to the properties on the javascript object?
bear.bibeault (675) [Avatar] Offline
#2
Re: DOM explanation in section 3.1 (Attributes, properties, NodeList) Conti
Essentially, in addition to storing the attributes in the nodelist as-is, properties are created directly on the Element that correspond to the attributes. I suppose this is done to make it easy to get to the values rather than having to deal with nodelists (which is a pain in the keester).
marleneayers (3) [Avatar] Offline
#3
Re: DOM explanation in section 3.1 (Attributes, properties, NodeList) Conti
I think I understand and thank you for responding! One more question:
On page 51
jQuery gives us the means to easily manipulate an element's attributes and gives us access to the element so that we can also change its properties...Let's start by looking at getting and setting element properties.

1. manipulate an element's attributes. Are we talking about the tag elements' attributes?
2. Gives us access to the element. Again...are we talking about the HTML tag element and the Javascript object properties?
3. Getting and setting element properties. Are you referring to the JS Object properties?

I think I am confused by the word element even into section 3.1.1 when you refer to modifying the properties of elements. Maybe I am being too literal. I am 60 years old and maybe learning is not quite as easy as it used to be!
marleneayers (3) [Avatar] Offline
#4
Re: DOM explanation in section 3.1 (Attributes, properties, NodeList) Conti
I just purchased the MEAP second edition and downloaded it. I read the revised section and it is much clearer now. By the way, I own most of the jquery books and this one is by and far the best of any of the jquery books. Congratulations on such an excellent job and I look forward to the new book release.
bear.bibeault (675) [Avatar] Offline
#5
Re: DOM explanation in section 3.1 (Attributes, properties, NodeList) Conti
Thanks for the feedback! Always appreciated.

And it's good to hear that the 2nd edition is clearer. We're working very hard to make sure that the 2nd edition is better and clearer than the original rather simply a rehash.