I have a xml like this
<Summary>
<Data>data1</Data>
<Data>data2</Data>
<Data>data3</Data>
...
</Summary>
Initially i used to do this when data was fixed
$(xml).find('Data').eq(0).text() // I got data1
$(xml).find('Data').eq(1).text() // I got data2
$(xml).find('Data').eq(2).text() // I got data3
What if i dont know how many Data elements are there. Is there any way to find out how many data elements i retrieved in my ajax request.
I don’t know if I fully understand what you want but the statement below would give you the number of Data elements: