Jquery/Ajax - XML Parsing - extract record according to criteria

lermontov

New Member
Is it possible to extract records from xml that match a query string criteria?For example I have the following parse script that parses a xml file, the page url can contain several different query strings such as music - would it be possible to read the query string and then only parse records that match the phrase in the query string?\[code\]$.ajax({ type: "GET",url: "#",dataType: "xml",success: function(xml) { $(xml).find("catalogueResult").each(function(i) { var mediaArtist = $("artist", this).text() var imgSrc = http://stackoverflow.com/questions/10621087/$("imageUrl", this).text() var title = $("title", this).text() var priceCode = $("priceCode", this).text() var mediaRow= $('<div class="mediaBlock"><div class="promoImg floL"><img src="'+imgSrc+'" width="75" alt="'+title+'"/></div><div class="promoContent"><h2>'+title+'</h2><h2 class="red">'+mediaArtist+'</h2><div class="buyBtn"><span><A href="http://www.mobilechilli.com">Buy Now</a></span></div></div></div>'); var compiledData = http://stackoverflow.com/questions/10621087/$(mediaRow); $(".recommends").append(compiledData); });}\[/code\]});
 
Back
Top