Am trying to read an XML response using getElementsByTagName
:
var rows = items.responseXML.getElementsByTagName("z:row");
for (var i=0; i<rows.length; i++)
{
//do something
}
Above code works fine in Firefox and IE but in chrome it throws null.. i mean it does not get any data.. when i alert
the rows.length
it gives me 0
always in chrome.
Then i searched in google and understood the issue is with xsd:element
, then i changed "z:row"
to only "row"
. Then it worked in Chrome but Firefox and IE returned 0
for rows.length
.
Is there any method which across all browsers?