JavaScript
  Home arrow JavaScript arrow Processing XML Data from AJAX Responses wi...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVASCRIPT

Processing XML Data from AJAX Responses with JavaScript
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2007-11-13

    Table of Contents:
  • Processing XML Data from AJAX Responses with JavaScript
  • Preparing the scenario for parsing XML data
  • Using the responseXML property
  • Assembling the different modules of the AJAX application

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Processing XML Data from AJAX Responses with JavaScript


    (Page 1 of 4 )

    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.

    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!

    More JavaScript Articles
    More By Alejandro Gervasio


       · During this last chapter of the series, you’ll learn how to develop a simple –yet...
     

    JAVASCRIPT ARTICLES

    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in
    - Active Client Pages at the Server
    - ACP Tab Web Page







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT