koblas
2008-May-21 19:24 UTC
BUG Firefox 3.0 - getElementsByClassName(...) returning HTMLCollection
Following code snipit: var links =(''Links'').getElementsByClassName(''link''); links.each(function(lnk) { .... }); Started failing with "each unknown function". While I "fixed" this with $(links).each(...) is this the future for how to interact with these, or is it a bug in prototype 1.6 and FF 3.0 ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Justin Perkins
2008-May-21 19:33 UTC
Re: BUG Firefox 3.0 - getElementsByClassName(...) returning HTMLCollection
This is not a bug with Prototype. getElementsByClassName is a native JavaScript method in Firefox 3. You should use select() or $$() instead. See the Prototype API for getElementsByClassName: http://prototypejs.org/api/element/methods/getElementsByClassName -justin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Peter De Berdt
2008-May-22 07:20 UTC
Re: BUG Firefox 3.0 - getElementsByClassName(...) returning HTMLCollection
On 21 May 2008, at 21:33, Justin Perkins wrote:> This is not a bug with Prototype. > > getElementsByClassName is a native JavaScript method in Firefox 3. You > should use select() or $$() instead. > > See the Prototype API for getElementsByClassName: > http://prototypejs.org/api/element/methods/getElementsByClassNameOr a workaround is to explicitely make it an array: $A(document.getElementsByClassName(...)) Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---