[Proto-Scripty] Re: iterator.call is not a function"

2009-07-02 Thread ColinFine
On Jul 1, 6:16 pm, Ian R wrote: > > $$('div.fp_YouTube').each(function(el)  { >         var player = el.select('.player'); >         var playlist = el.select('.playlist'); >         playlist.select('li').each(function(video)      { >                 console.log(video.id); >         }); > > });

[Proto-Scripty] Re: "iterator.call is not a function"

2009-07-01 Thread Rick Waldron
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 el.select(): $$('div.fp_YouTube').each(function(el) { var player = el.select('.player')[0]; // <--- right here!

[Proto-Scripty] Re: "iterator.call is not a function"

2009-07-01 Thread Ian R
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 wor

[Proto-Scripty] Re: "iterator.call is not a function"

2009-07-01 Thread Alex McAuley
Is it returning an array ? Check with $$('div.fp_YouTube').each(function(el) { var player = el.select('.player'); var playlist = el.select('.playlist'); alert(playlist); // see if its an object return; playlist.select('li').each(function(video) { console.log(video.id); }); }); if it is returnin

[Proto-Scripty] Re: iterator.call is not a function"

2009-07-01 Thread Ian R
This sent off by accident before I was done. I've resubmitted a complete post here: http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/fe0e1581be6b861f?hl=en Forgive me but I cannot seem to delete this one, though the instructions seem pretty straightforward (click the