Hi, I have this piece of code:
var div = AAA_getElementsByClassName(document,
"div",cosa.toLowerCase()+"_0_"+id);
div.each(function(item){item.setStyle({display:''block''});});
It works on FF, but not with IE. The error is in the second line:
properties or method not supported.
The "div" variable contains the value to "show" so the first
line works.
Where is my error ?
Tnx.
M.
--
Michel ''ZioBudda'' Morelli
michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org
http://www.ziobudda.net ICQ: 58351764
http://www.phpbook.it FAX: 0291390660
http://www.ajaxblog.it TEL: 3939890025
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Also remember that you can use #invoke instead of #each for these kind
of things.
div.invoke(''setStyle'', {display: ''block''});
Martin
On 3/19/07, Colin Mollenhour
<eliteii92g-NPSFNn/7+NYVo650/ln6uw@public.gmane.org>
wrote:>
> Does AAA_get_elementsByClassName extend each element in the resulting
> array? If it is an alias for a prototype function, are you using the
> latest version available? 1.5.1_rc1 had some problems not extending
> elements that were fixed in rc2.
>
> Colin
>
> zio budda wrote:
> > Hi, I have this piece of code:
> >
> > var div = AAA_getElementsByClassName(document,
> > "div",cosa.toLowerCase()+"_0_"+id);
> >
div.each(function(item){item.setStyle({display:''block''});});
> >
> > It works on FF, but not with IE. The error is in the second line:
> > properties or method not supported.
> > The "div" variable contains the value to "show" so
the first line works.
> >
> > Where is my error ?
> >
> > Tnx.
> >
> > M.
> >
> > --
> > Michel ''ZioBudda'' Morelli
michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org
> > http://www.ziobudda.net ICQ: 58351764
> > http://www.phpbook.it FAX: 0291390660
> > http://www.ajaxblog.it TEL: 3939890025
> >
> > >
> >
> >
>
>
> >
>
--
burnfield.com/martin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
Does AAA_get_elementsByClassName extend each element in the resulting array? If it is an alias for a prototype function, are you using the latest version available? 1.5.1_rc1 had some problems not extending elements that were fixed in rc2. Colin zio budda wrote:> Hi, I have this piece of code: > > var div = AAA_getElementsByClassName(document, > "div",cosa.toLowerCase()+"_0_"+id); > div.each(function(item){item.setStyle({display:''block''});}); > > It works on FF, but not with IE. The error is in the second line: > properties or method not supported. > The "div" variable contains the value to "show" so the first line works. > > Where is my error ? > > Tnx. > > M. > > -- > Michel ''ZioBudda'' Morelli michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org > http://www.ziobudda.net ICQ: 58351764 > http://www.phpbook.it FAX: 0291390660 > http://www.ajaxblog.it TEL: 3939890025 > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 Mar 19, 12:45 pm, "Martin Ström" <martinstromli...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Also remember that you can use #invoke instead of #each for these kind > of things. > > div.invoke(''setStyle'', {display: ''block''});nope. Same error. With this code all works: for (var i = 0; i<div.size();i++) { $(div[i].id).setStyle({display:''block''}); //div.invoke(''setStyle'', {display: ''block''}); } But I don''t understand because it. M. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey there, ziobudda a écrit :> $(div[i].id).setStyle({display:''block''});So you need to extend the elements? The DOM references you have in DIV are unextended yet? Use this: div.invoke(Element.extend).invoke(''setStyle'', { display: ''block'' }); Or if you don''t want to double-loop: div.each(function(d) { $(d).setStyle({ display: ''block'' }); }); -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2007/3/19, Christophe Porteneuve <tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org>:> So you need to extend the elements? The DOM references you have in DIV > are unextended yet?I think: yes. not extended.> Or if you don''t want to double-loop: > > div.each(function(d) { > $(d).setStyle({ display: ''block'' }); > });this work. Tnx. -- Michel ''ZioBudda'' Morelli michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org http://www.ziobudda.net ICQ: 58351764 http://www.phpbook.it FAX: 0291390660 http://www.ajaxblog.it TEL: 3939890025 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---