jonKushner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-19 13:54 UTC
Prototype.Browser in new Version - SWEET!
$A($H(Prototype.Browser)).each(function(s){ if(s.value == true){ return s.key; } }); //Gecko --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Well... just please remember to favor object detection and resort to this when everthing else failed. On Mar 19, 9:54 am, "jonKush...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <jonKush...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> $A($H(Prototype.Browser)).each(function(s){ > if(s.value == true){ > return s.key; > }}); > > //Gecko--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Just an FYI, if you are trying to store the current browser''s name in a variable you''ll want to use detect/find: var browser = $H(Prototype.Browser).find(function(b){ return b.value; }).key; //Gecko Colin jonKushner-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> $A($H(Prototype.Browser)).each(function(s){ > if(s.value == true){ > return s.key; > } > }); > //Gecko > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---