Monday, April 27, 2015

jQuery - Populating presidents dropdown list in XML format

Building off of my last post on how to retrieve XML data using jQuery and AJAX, here's an example of how to consume the XML data. In this example we'll iterate through a sub-set of U.S. Presidents data from a free data service called MySafeInfo. The presidents data is in a node named p and it has attributes for the president's ID (id), name (nm), political party (pp), and term (tm).



This example relies on jQuery and uses mysafeinfo.com to retrieve U.S. Presidents data in XML format. MySafeInfo is a free service we offer to software developers to provide test data in a simple, flexible manner, in a variety of formats, including XML, JSON, JSONP, CSV, and more.

0 comments: