December 2013
Intermediate to advanced
384 pages
9h 54m
English
$.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 ...
Read now
Unlock full access