Voroavoisse
New Member
I am using jQuery to parse an XML file.When I use: \[code\]$(xml).find("dealer").each(function()\[/code\], it works and it finds each node with the name "dealer".But when I add: \[code\]if ($(this).find("code").text() == myVar){}\[/code\] inside of that function (which checks to see if the node named "code" inside of the "dealer" node is equal to myVar), it stops at the first node it finds that the "code" node is equal to myVar and doesn't find the rest.EDIT: Each "dealer" node only has one "code" node in the XML. I want to check and see which dealer has a code equal to myVar.Full Code:\[code\]function myFunction(){ $.ajax({ type: "GET", url: "../wherebuy/myXML.xml", dataType: "xml", success: parseXml }) function parseXml(xml){ $(xml).find("dealer").each(function(){ if($(this).find("code").text() == myVar){ } }) }}\[/code\]