Just a quick one, bear with me as I''m a prototype nOOb...:-) The following code works in firefox, but IE7 complain that it cannot get the display property? ----------------------------------------------- var elms = $(''sort_container'').getElementsByClassName(''grouped_''+idx); for(var i=0; i<elms.length; i++){ elms[i].style.display = "none" } ----------------------------------------------- I am stumped by this, please help... Cheers, Bjorn --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
OK I got it working...you can ignore this post! On Jan 16, 11:43 pm, "Bjørn" <bjorn.ne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Just a quick one, bear with me as I''m a prototype nOOb...:-) > The following code works in firefox, but IE7 complain that it cannot > get the display property? > ----------------------------------------------- > var elms = $(''sort_container'').getElementsByClassName(''grouped_''+idx); > for(var i=0; i<elms.length; i++){ > elms[i].style.display = "none"} > > ----------------------------------------------- > I am stumped by this, please help... > > Cheers, > Bjorn--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jan 16, 2008 4:43 PM, Bjørn <bjorn.nesby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Just a quick one, bear with me as I''m a prototype nOOb...:-) > The following code works in firefox, but IE7 complain that it cannot > get the display property? > ----------------------------------------------- > var elms = $(''sort_container'').getElementsByClassName(''grouped_''+idx); > for(var i=0; i<elms.length; i++){ > elms[i].style.display = "none" > } > -----------------------------------------------If you''re using the latest version of prototype (1.6.0.x), then you should update that code a wee bit to use the select() method instead of getElementsByClassName(). Here is a prototype-ized version of your code: $$(''#sort_container grouped_'' + idx).invoke(''hide''); Or... $(''sort_container'').select(''grouped_'' + idx).invoke(''hide''); Have a great day. -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 -~----------~----~----~----~------~----~------~--~---
Hi Justin, That is really compact code, thanks for the example! BTW: In documentation, $$ still state GetElementByClassName as alternative, even if it''s now depricated? /Bjorn On Jan 17, 12:18 am, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jan 16, 2008 4:43 PM, Bjørn <bjorn.ne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Just a quick one, bear with me as I''m a prototype nOOb...:-) > > The following code works in firefox, but IE7 complain that it cannot > > get the display property? > > ----------------------------------------------- > > var elms = $(''sort_container'').getElementsByClassName(''grouped_''+idx); > > for(var i=0; i<elms.length; i++){ > > elms[i].style.display = "none" > > } > > ----------------------------------------------- > > If you''re using the latest version of prototype (1.6.0.x), then you > should update that code a wee bit to use the select() method instead > of getElementsByClassName(). Here is a prototype-ized version of your > code: > > $$(''#sort_container grouped_'' + idx).invoke(''hide''); > > Or... > > $(''sort_container'').select(''grouped_'' + idx).invoke(''hide''); > > Have a great day. > > -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 -~----------~----~----~----~------~----~------~--~---
On Jan 17, 2008 7:43 AM, Bjørn <bjorn.nesby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> BTW: In documentation, $$ still state GetElementByClassName as > alternative, even if it''s now depricated?See this page, note the warning: http://prototypejs.org/api/utility/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 -~----------~----~----~----~------~----~------~--~---