Return to Snippet

Revision: 30443
at August 14, 2010 00:19 by joshharbaugh


Updated Code
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));
          });
     }
});

Revision: 30442
at August 14, 2010 00:17 by joshharbaugh


Initial Code
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));
                             });
			}
		});

Initial URL


Initial Description
A snippet setup to grab an XML file, parse it, and return the data contained within.

Initial Title
Parsing XML with JQuery\'s AJAX

Initial Tags
ajax, jquery

Initial Language
jQuery