Thanks - I'm finding the selectors method a lot slower than both "The Ultimate" version and Prototype's getElementsByClassName, at least for pages with large DOMs.
Jeff Rankin
Human Factors
544-4333
Eric Anderson <[EMAIL PROTECTED]>
Sent by: To:
[email protected]
[EMAIL PROTECTED] cc: (bcc: William J.
Rankin/UPC)
onrails.org Subject:
[Rails-spinoffs] Re: Limiting getElementsByClassName to
specific
nodes and entities
05/30/2006 03:58 PM
Please respond to rails-spinoffs
Jeff Rankin wrote:
> var widgets = getElementsByClassName(document, "ol", "tree");
Couldn't you use the selectors support. So the above would be:
widgets = $$('ol.tree');
If you wanted to limit it to just a certain subset of the document to
search you could do:
widgets = $$('#my_section ol.tree');
The implementation of $$ seems quite efficient and I have yet to have
performance problems.
Eric
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
