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, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> 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:
>
>
>
> > [EMAIL PROTECTED] 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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---