Using a jQuery .get() AJAX Request to Handle XML Data

$.get("getXMLData.php", myHandler); function myHandler(data){   var parks = $(data).find("park");   parks.each(function(){     var value = $(this).children("value").text();   } }

Using jQuery to get XML data from the server is a bit different from using JSON data. You still call the .get(url, handler(data)) method and pass in the url to the server location and specify a handler to handle the data. For example:

$.get("getXMLData.php", myHandler);

However, the XML data returned by the response will be a DOM object that is passed as the first argument to the handler function. The best way to handle the DOM object is to convert ...

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.