see array.filter
myLinks.filter(function(link){ return link.get('href'); });
On Sat, Jan 2, 2010 at 6:50 PM, mmjaeger <[email protected]> wrote:
> stupid me - sorry - I need to get the hrefs into an array and then
> encode it - thanks for replying
>
> On Jan 2, 6:44 pm, Aaron Newton <[email protected]> wrote:
> > DOM elements are not JSON encodable (what would you expect it to do with
> > them?).
> >
> >
> >
> > On Sat, Jan 2, 2010 at 6:31 PM, mmjaeger <[email protected]> wrote:
> > > Hello
> > > I've the following code:
> > > var arr = document.id(document.body).getElements('a[href$=mp3]');
> > > console.log(arr.length); // RETURNS 6
> > > console.log('JSON: ' + JSON.encode(arr)); // RETURNS JUST []
> >
> > > what am I missing?
> >
> > > Thank you
>