[jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently
This gets the variables at the top level and gives me the correct
count for each level.
function parseXml(xml) {
$(xml).find('sites').each(function(){
var PARENT = $(this).children($(this).attr('id'));
var PARENTcount = PARENT.length;
var PARENTSchildren = $(PARENT).children($(this).attr('label'));
var CHILDRENcount = PARENTSchildren.length;
var CHILDSchildren = $(PARENTSchildren).children($(this).attr
('label'));
var CHILDScount = CHILDSchildren.length;
alert(PARENTcount)
alert(CHILDRENcount)
alert(CHILDScount)
});
}
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home