I am not sure if there is a mistake in my existing code or the functionality in Jquery Array is like below:
var categories = [];
$(this).children('categories').each(function() {
categories.push($(this).find('name').text());
});
Now when I have the below XML node :
<categories>
<name>a</name>
<name>b</name>
<name>c</name>
</categories>
I see that in Firebug the categories array has one element - "abc" but actually it should be as index 2 with values as 'a','b' and 'c'
Is there something wrong in my code?