Because:

On Apr 6, 7:58 am, "Yansky" <[EMAIL PROTECTED]> wrote:
> $.map(theData, function(i){
>   return i.childNodes[0].nodeValue;
>
> });

The .map function is returning an array of the result of each function
call - in your case:

>   return i.childNodes[0].nodeValue;

You second block doesn't work because ...

>  $(this).text();

...isn't actually returning anything.

Try this:

var myData = [];
$('.wordbreakfield').each(function() {
  myData.push($(this).text());
});

That said, you've almost got what you need with the map function

var myData = $.map($('.wordbreakfield'), function() {
  return $(this).text();
});

Hope that helps.

Reply via email to