SunQuest
 
       JavaScript
  Home arrow JavaScript arrow Parsing AJAX Responses with JavaScript and...
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  
Dedicated Servers  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 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

Parsing AJAX Responses with JavaScript and the innerHTML Property
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2007-10-30

    Table of Contents:
  • Parsing AJAX Responses with JavaScript and the innerHTML Property
  • Working with HTTP XML Request objects
  • Parsing web server responses
  • The full source code of the sample 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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Parsing AJAX Responses with JavaScript and the innerHTML Property


    (Page 1 of 4 )

    If you work with AJAX and have ever wondered which approach is best to use when parsing the responses triggered by a web server after performing an HTTP request, this article series is for you. Composed of three parts, it will lay out your options and the most efficient approaches. This article, the first part of the series, focuses on the "responseText" property and the "innerHTML" property.

    If you're a web developer who has already tasted the power of AJAX, then you're familiar with the buzzwords associated with this technology and the correct utilization of all of its methods and properties. Indeed, developing AJAX-driven web applications on a frequent basis will give you a strong sense of confidence in mastering the pillars of this web development area, such as working with HTTP requester objects, handling synchronous and asynchronous HTTP requests, and logically processing the range of responses sent by a web server and triggered by a JavaScript application.

    However, while acquiring a decent background in how to work with AJAX is actually a no-brainer process that can be tackled with minor hassles, the truth is that eventually you may have some gaps on this topic that naturally must be properly filled in. But what do I really mean by filling in some gaps? Well, if you found yourself scratching your head trying to figure out what AJAX property is better to use to parse a specific web server response, then you may need to take a look at some approaches to how to achieve this as painlessly as possible.

    AJAX offers only two primary properties to parse all of the HTTP responses sent by a web server; these are the "responseText" and "responseXML." Even so, there are certain situations during the development of an AJAX application that can be quite challenging to tackle, particularly if you have serious doubts about how to process the outputs of JavaScript-based HTTP requests.

    Therefore, in this three-part series of articles, I'll be showing you by means of numerous code samples, different approaches that you may want to use to parse all of the responses triggered by a web server after performing an AJAX HTTP request. These tutorials will cover both text and XML-based responses, in this way providing you with a friendly guide on how to process AJAX requests with minor hassles.

    Speaking more specifically, the first installment of the series will walk you through  working with the popular "responseText" property, so get ready to sharpen your existing skills for processing text-based responses with AJAX. Let's begin this educational journey now!

    More JavaScript Articles
    More By Alejandro Gervasio


       · Over the course of this initial installment of the series, the JavaScript...
     

    JAVASCRIPT ARTICLES

    - Detect Browser Compatibility with the Reques...
    - Using the EXT JS Date Picker Widget
    - Ajax Hack for Entering Information Without R...
    - EXT JS 2.1 Overview
    - Using the Style Object for Zebra Tables with...
    - Binary Searching
    - An Improved Approach to Building Zebra Tables
    - Assigning Background Colors Dynamically to Z...
    - Building Zebra Tables with CSS and JavaScript
    - JavaScript: Array Objects
    - A Closer Look at Smart Markers with Yahoo! M...
    - Using Polylines and Smart Markers with Yahoo...
    - Bulleted Menu of Links
    - Creating Click Loggers and Basic Markers wit...
    - Adding Pan Controls to Yahoo! Maps







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway