Specifically, I discuss some of what I’ve learned from developing, and working with the users of, jQuery and developing the new FUEL library for Firefox 3.
Materials and Links:
- Presentation Files (PDF)
- FUEL Extension Library
- “jQuery2” A meta-language for jQuery
Dao (April 24, 2007 at 5:58 pm)
Nice. I’m not quite through it, but two notes so far:
– a boolean value set as an attribute will be converted to a string, so foo.setAttribute(“disabled”, false); results in disabled=”false”. And an element is disabled as soon as the attribute is present, so … yeah, irritating at first, but it kind of makes sense.
– contrary to foo.class = “bar”, foo.setAttribute(“class”, “bar”) does work.
Dao (April 24, 2007 at 6:24 pm)
– this picks even table rows in CSS3: tr:nth-child(2n)
– when mixing CSS3 and XPath as in $(“ul[ul]”), how do you differentiate a list that contains a list from a list that has an “ul” attribute?
Bradley (April 25, 2007 at 6:54 am)
Unordered list with ul attribute:
Unordered list with another inside:
Unordered list with another as a direct descendant:
$(‘ul > ul’)
Of course, the last one would be illegal (X)HTML Strict (Transitional too?). More selectors here: http://docs.jquery.com/DOM/Traversing/Selectors
Jordan Sissel (May 1, 2007 at 1:32 pm)
I think what John was pointing out about ul[ul] only being valid in xpath, as there’s no way to specify predicates about child elements, only predicates about node attributes, iirc.
Things in  are predicates/assertions, not selectors, in xpath. So, ul[ul] would say “match me a ul element that has a child somewhere that is also a ul”
CSS ‘ul ul’ is not the same as XPATH ‘ul[ul]’
CSS ‘ul ul’ is the same as XPATH ‘ul/ul’