Home arrow JavaScript arrow Processing XML Data from AJAX Responses with JavaScript
JAVASCRIPT

Processing XML Data from AJAX Responses with JavaScript


Developing AJAX-driven applications can be an educational experience, particularly for those web developers who are taking their first steps into this exciting area. However, on the other hand, it can also be hard, specifically when it comes to deciding which output format should be used for delivering the results of AJAX-based http requests to end users. This article offers one sensible approach.

Author Info:
By: Alejandro Gervasio
Rating: 4 stars4 stars4 stars4 stars4 stars / 4
November 13, 2007
TABLE OF CONTENTS:
  1. · Processing XML Data from AJAX Responses with JavaScript
  2. · Preparing the scenario for parsing XML data
  3. · Using the responseXML property
  4. · Assembling the different modules of the AJAX application

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Processing XML Data from AJAX Responses with JavaScript
(Page 1 of 4 )

Introduction

Welcome to the final installment of the series that began with "Parsing AJAX responses with JavaScript." In order to address the aforementioned issue, this series demonstrates different approaches that can be used to process AJAX responses, ranging from handling data delivered in plain text format, to parsing entire XML documents.

Now that I've introduced you to the subject of this series, I'd like to refresh your memory of the topics that I covered in the preceding article. This will help you to see the continuity between that tutorial and this one, which hopefully you're reading with careful attention.

Put in a simple way, you'll remember that in the previous article of the series, I developed a simple AJAX application whose primary functionality was displaying on the browser a set of database records. These records were fetched from a sample database table by using a couple of PHP 5 classes. It's worth mentioning here that these database rows were rotated at a predefined time interval, in this case utilizing a simple JavaScript timer.

Of course, the most important thing to note here, beyond the programmatic logic implemented by this AJAX-based application, is that each database record was parsed in the client by utilizing a few common DOM methods. This illustrated that it is perfectly plausible to use a standard approach to parse AJAX responses.

Nonetheless, even when the AJAX technology exposes only two primary properties for fetching data from the server, named "responseText" and "responseXML" respectively, I have to admit that the subject is really huge and quite challenging. Thus, considering that hopefully you grasped the different techniques that I developed in the two previous articles of this series for parsing AJAX responses served as plain text, in this last tutorial I'm going to show you how to process these responses utilizing the "responseXML" property. Sounds quite interesting, right?

With the preliminaries out of our way, now let's find out how to parse AJAX responses that are delivered in XML. Let's get started!


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials