The reason you need to use an index on playlist is because select returns an
array, so... instead of using the index[0] the way you've done, you can send
it back to the

$$('div.fp_YouTube').each(function(el)  {
       var player   ='.player')[0]; // <--- right here!
       var playlist ='.playlist li'); // also... select your li's
here, this will save you another select() call on the next line!
       playlist.each(function(video)      { // <-- neater.

Have a look:


On Wed, Jul 1, 2009 at 1:37 PM, Ian R <> wrote:

> I did check on the array situation -- it's so good and bad that
> finally turning to this forum and *writing it all down* usually solves
> the problem!
> In the above case, $(playlist).select('li').each didn't work, but
> playlist[0].select('li').each does.
> I'm not sure that I exactly LOVE how that works, but it's not
> terrible.  If there's a better way, I'd love to know about it.
> Thanks!
> Ian
> >

You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to