Hello, how can i select all elements having a defined id or name. + extension like this myid_1 myid_2 myid_3 ____________ Virus checked by G DATA AntiVirusKit Version: AVK 18.330 from 06.11.2007 Virus news: www.antiviruslab.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Maybe $(''myid_1'', ''myid_2'', ''myid_3'')? I think you can''t get them like myid_*. Is it possible to get parent node''s childNodes? On Nov 7, 11:17 pm, "reta...-Mmb7MZpHnFY@public.gmane.org" <reta...-Mmb7MZpHnFY@public.gmane.org> wrote:> Hello, > > how can i select all elements having a defined id or name. + extension > like this > > myid_1 > myid_2 > myid_3 > > ____________ > Virus checked by G DATA AntiVirusKit > Version: AVK 18.330 from 06.11.2007 > Virus news:www.antiviruslab.com--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I dont know the count of the elements> Maybe $(''myid_1'', ''myid_2'', ''myid_3'')? > > I think you can''t get them like myid_*. Is it possible to get parent > node''s childNodes? > > On Nov 7, 11:17 pm, "reta...-Mmb7MZpHnFY@public.gmane.org" <reta...-Mmb7MZpHnFY@public.gmane.org> wrote: >> Hello, >> >> how can i select all elements having a defined id or name. + extension >> like this >> >> myid_1 >> myid_2 >> myid_3 >> >> ____________ >> Virus checked by G DATA AntiVirusKit >> Version: AVK 18.330 from 06.11.2007 >> Virus news:www.antiviruslab.com > > > >____________ Virus checked by G DATA AntiVirusKit Version: AVK 18.366 from 07.11.2007 Virus news: www.antiviruslab.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
retacom-Mmb7MZpHnFY@public.gmane.org wrote:> Hello, > > how can i select all elements having a defined id or name. + extension > like this > > myid_1 > myid_2 > myid_3 >// CSS Selector for all elements with id beginning with "myid_" // see http://gallery.theopalgroup.com/selectoracle/ var elements = $$(''[id^="myid_"]''); - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Helo , thanks, and how can i get every element to sum this>> > // CSS Selector for all elements with id beginning with "myid_" > // see http://gallery.theopalgroup.com/selectoracle/ > var elements = $$(''[id^="myid_"]'');____________ Virus checked by G DATA AntiVirusKit Version: AVK 18.368 from 07.11.2007 Virus news: www.antiviruslab.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello i try this to get all values var elements = $$(''[id^="tsum["]''); for (i in elements) { alert("The key is "+i+" and the value "+elements[i].innerHTML); } the fuirst elements all ok but then i get some strange elements having undefined values. i thing thats methods of prototype Ken Snyder schrieb:> retacom-Mmb7MZpHnFY@public.gmane.org wrote: >> Hello, >> >> how can i select all elements having a defined id or name. + extension >> like this >> >> myid_1 >> myid_2 >> myid_3 >> > // CSS Selector for all elements with id beginning with "myid_" > // see http://gallery.theopalgroup.com/selectoracle/ > var elements = $$(''[id^="myid_"]''); > > - Ken Snyder > > >____________ Virus checked by G DATA AntiVirusKit Version: AVK 18.368 from 07.11.2007 Virus news: www.antiviruslab.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
retacom-Mmb7MZpHnFY@public.gmane.org wrote:> Hello i try this to get all values > > var elements = $$(''[id^="tsum["]''); > for (i in elements) > { > alert("The key is "+i+" and the value "+elements[i].innerHTML); > } > > > the fuirst elements all ok but then i get some strange elements having > undefined values. i thing thats methods of prototypeYou should always iterate Array objects using numeric iteration or Array.prototype iteration. What you''re doing is object property iteration. Array has properties in addition to its members. // traditional iteration for (i = 0; i < elements.length; i++) { alert( ''the id key is '' + parseFloat(elements[i].substring(4)) + '' and the value is " + elements[i].innerHTML ); } // Array.prototype iteration (Prototype Enumerable#each) elements.each(function(element) { alert( ''the id key is '' + parseFloat(element.substring(4)) + '' and the value is " + element.innerHTML ); }); - Ken --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Prototype breaks the ''for... in'' iteration if you are using it on an array. It''s not even needed here. The ''traditional'' iteration or the ''.each()-method'' are better in this situation. for(.. in.. ) works best if used for Objects... in that case prototype won''t break it. Greetz On Nov 7, 7:47 pm, "reta...-Mmb7MZpHnFY@public.gmane.org" <reta...-Mmb7MZpHnFY@public.gmane.org> wrote:> Hello i try this to get all values > > var elements = $$(''[id^="tsum["]''); > for (i in elements) > { > alert("The key is "+i+" and the value "+elements[i].innerHTML); > } > > the fuirst elements all ok but then i get some strange elements having > undefined values. i thing thats methods of prototype > > Ken Snyder schrieb: > > > > > reta...-Mmb7MZpHnFY@public.gmane.org wrote: > >> Hello, > > >> how can i select all elements having a defined id or name. + extension > >> like this > > >> myid_1 > >> myid_2 > >> myid_3 > > > // CSS Selector for all elements with id beginning with "myid_" > > // seehttp://gallery.theopalgroup.com/selectoracle/ > > var elements = $$(''[id^="myid_"]''); > > > - Ken Snyder > > ____________ > Virus checked by G DATA AntiVirusKit > Version: AVK 18.368 from 07.11.2007 > Virus news:www.antiviruslab.com--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---