On 24 Mar 2008, at 23:00, Steve Upton wrote:

> Safari 3.1 implements its own getElementsByClassName and messes up  
> Prototype.
>
> A short summary is available here:
>
> <http://blog.caboo.se/articles/2008/3/21/safari-3-1-breaks-your-app>
>
> The above blog entry suggests substituting $$ for  
> getElementsByClassName as a work-around and I see that the Prototype  
> documentation lists getElementsByClassName as "deprecated".
>
> My problem is that I use the 'parentElement' option in Prototype's  
> getElementsByClassName fairly often so $$ is not an effective  
> substitution.
>
> So, is there a variation on $$ that constrains the search to a  
> specific node?
>
> I have yet to hear a comment on this list regarding Safari 3.1's  
> change and how it affects Prototype. Am I the only one feeling this  
> pain. This broke our site in a few important ways...
>
> Is there a short-term hack I can apply to Prototype to get it to  
> allow me to use Safari's getElementsByClassName (which appears to  
> support the parentElement option)?
>
> Is there something I'm missing here?

Just use $A(document.getElementsByClassName('foo')) instead of  
document.getElementsByClassName('foo') and you will have an array of  
extended elements, which is what you probably want. Simple workaround  
and haven't had any problems with it yet, both on Safari 3.1 and  
Firefox 3 beta (which also implements a native 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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to