Gregory Hill
2006-Apr-17 19:37 UTC
RE: document.getElementsByClassName (prototype) andElement.childrenWithClassName (scriptaculous) redundancy?
Isn''t the difference that the scriptaculous one only gets child nodes from the node you specify, whereas the prototype one gets all in the entire document? Still, it would be nice to just have the one, and let you pass in the document element if you wanted all of them. Just guessing, really. I haven''t looked at the code in question. Greg> -----Original Message----- > From: rails-spinoffs-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org[mailto:rails-spinoffs-> bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Jeremy Kitchen > Sent: Monday, April 17, 2006 12:40 PM > To: rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > Subject: Re: [Rails-spinoffs] document.getElementsByClassName(prototype)> andElement.childrenWithClassName (scriptaculous) redundancy? > > On Monday 17 April 2006 11:24, Jeremy Kitchen wrote: > > Is there a reason scriptaculous provides what appears to be aredundant> > function? The reason I''m asking is that it only seems to be usedtwice> > throughout all of scriptaculous, and it doesn''t appear to workproperly> > (for some reason it''s returning the actual element, rather than anarray> > with all of the elements) > > actually, it is working properly, the function that is calling it is > simply > interpreting the results incorrectly :) > > However, there''s still that redundancy. I''ve filed a ticket aboutthis> here: > http://dev.rubyonrails.org/ticket/4766 > > any input would be greatly appreciated :) > > -Jeremy > > -- > Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org > > In the beginning was The Word and The Word was Content-type:text/plain> -- The Word of Bob. > > And the lord said unto John; Come forth and receive eternal life. John > came > fifth and won a toaster.
Todd Ross
2006-Apr-17 20:25 UTC
Re: document.getElementsByClassName (prototype) andElement.childrenWithClassName (scriptaculous) redundancy?
On 4/17/06, Gregory Hill <Gregory_Hill-l9nu40+TWxQ@public.gmane.org> wrote:> Isn''t the difference that the scriptaculous one only gets child nodes > from the node you specify, whereas the prototype one gets all in the > entire document?Prototype''s document.getElementsByClassName allows you to pass in the parentElement as the second parameter. Todd
Jeremy Kitchen
2006-Apr-17 21:26 UTC
Re: document.getElementsByClassName (prototype) andElement.childrenWithClassName (scriptaculous) redundancy?
On Monday 17 April 2006 12:37, Gregory Hill wrote:> Isn''t the difference that the scriptaculous one only gets child nodes > from the node you specify, whereas the prototype one gets all in the > entire document?the prototype one allows you to pass in an element to start with: document.getElementsByClassName(''foo'', ''bar''); will return all of the elements descending from the element with the id of bar. -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. And the lord said unto John; Come forth and receive eternal life. John came fifth and won a toaster. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Possibly Parallel Threads
- document.getElementsByClassName (prototype) and Element.childrenWithClassName (scriptaculous) redundancy?
- Bug? IE, getElementsByClassName and "length"
- Effect.toggle error in 1.6.1
- childrenWithClassName
- [prototype] Selector class fails on selector strings with spaces