jquery - Paring XML that is equal to a parsed field -
having played around wondering i'm going wrong? parsing xml file returns lots of fields within xml file , want return rows of xml equal or greater referenced field.
the 'occ' field trying reference figured needed state integer using parseint. xml parser looks under "fault' category , brings data, stated want show occurances (occ) greater or equal 5, within normal scope of xml there 1's through 10's example.
here's code have:
$(xml).find("fault").each(function () { liv = $(this).attr("live"); var partname = $(this).find("part").text(); var defect = $(this).find("defect").text(); var model = $(this).find("model").text(); var location = $(this).find("location").text(); var causal = $(this).find("causal").text(); var occ = parseint($(this).find("occ").text()); var wkzero = $(this).find("wkzero").text(); var wkone = $(this).find("wkone").text(); var wktwo = $(this).find("wktwo").text(); var wkthree = $(this).find("wkthree").text(); var keyserial = $(this).find("keyserial").text();
i have tried changing first line be:
$(xml).find("occ:gt(4)").each(function () {
to no avail... able explain how accomplish please? thanks...
trying go wrong way, sussed out adding @ end want reference...:
if(occ>=(val)){ other code here... }
Comments
Post a Comment