/ Published in: jQuery

A snippet setup to grab an XML file, parse it, and return the data contained within.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jQuery.ajax({ type: "GET", url: "dates.xml", dataType: "xml", success: function(xml) { jQuery(xml).find('date').each(function(){ date = jQuery(this).find('value').text(); var output = '<span class="date">'+date+'</span>'; jQuery('body').append(jQuery(output)); }); } });
Comments
