On Jul 1, 6:16 pm, Ian R i...@fairmountfair.com 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);
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
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
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!