• flickr
  • linkedin
  • twitter
  • rss
print out xml data that is loaded in javascript / AJAX

print out xml data that is loaded in javascript / AJAX

Paranoid the reason nothing is coming out is that nothing is coming in? This is a nice and easy alert option to print out your XML doc as an alert, so you know the data’s there. If nothing’s working – it’s some other reason!

$.ajax({
type: "GET",
url: "courses.xml",
dataType: "xml",
success: function (data) {
alert("data loaded: " + new XMLSerializer().serializeToString(data));

}
Tech Reference: ,

Larry's a 30-something chap interested in travel, being a dork and changing the world via less boring training.

Leave a reply