|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Confused about qx.bom.CollectionHi list. Could somebody enlighten me what i'am doing wrong here?
I want to get all the "<b>" tags (with their full content/children) out of a block of html (as a string)... ************************ var foo = qx.bom.Collection.html('<a><b></b><div/><b><script/></b><a>'); bar = foo.filter("b"); bar.forEach(this.doSomething); ************************ When i debug this _foo.length_ is "3", which i totaly don't get and _bar.length is_ "0". Is this not the right way to do it? I looked at Element.useMarkup, but this seems limited to single html elements, not trees. Thanks in advance, Martin ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: Confused about qx.bom.Collection
Martin,
First off, your supplied HTML string is not well-formed, so that's going to cause some confusion regardless of the rest of my answer. Also, qx.bom.Collection.html takes your string as input and parses it into multiple collection elements based on DOM levels, so it detected 3 distinct DOM elements in your string and separated them into 3 items in the collection. This is why foo.length returns 3. It's likely that the way it broke down the HTML string is the reason your other command is not working correctly. So, start with a well-formed HTML string and then re-evaluate your returned values from there, realizing that the collection will have more than one item - that should make more sense. HTH, Gene On Wed, 2009-11-04 at 16:43 +0100, Martin Contento wrote:
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
| Free embeddable forum powered by Nabble | Forum Help |