That method looks like it works a little bit different. It looks at
all the ol tags and looks for a class of tree on those tags. The
prototype version doesn't take any parameters for tag name. It is
used like this:
var trees = document.getElementsByClassName('tree', parent_dom_element_or_id);
As you said the second element is optional if you don't pass it it
looks at all tags under document.body.
Nicholas
On 5/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I'm currently using "The Ultimate getElementsByClassName"
(http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/)
instead of the Prototype version. This version seems to be faster since it
lets you specify the starting node and the type of entity. For example:
var widgets = getElementsByClassName(document, "ol", "tree");
Is there a way to do this within Prototype's version? Looking at the code,
it looks like you may be able to pass the parent node, can anyone verify
this? Is there a benefit to building this same functionality into
Prototype, or is it best to stick with "The Ultimate..." version? I'm at
the beginning of developing a set of reusable GUI components and would like
to minimize dependencies where possible.
Thank you,
Jeff Rankin
Human Factors
544-4333
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
--
DCRails.com || Making the Metrorail fun!
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs