Home arrow JavaScript arrow JavaScript Remote Scripting: Processing XML Files
JAVASCRIPT

JavaScript Remote Scripting: Processing XML Files


In this article, you will learn how to use AJAX for reading and manipulating simple XML files, in order to implement a basic Web service. Specifically, you will learn how to develop a JavaScript application that fetches data from an XML file. By the end of this article, you will know the basics for using client-side parsed XML in your own applications.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 18
October 05, 2005
TABLE OF CONTENTS:
  1. · JavaScript Remote Scripting: Processing XML Files
  2. · XML in the client: the basics of AJAX XML processing
  3. · Reading XML files with AJAX: defining the “sendRequest()” function
  4. · Checking the progress of a request: a quick look at the “stateChecker()” function
  5. · Displaying XML data: defining the “createDataContainer()” and “displayData()” functions
  6. · Putting the pieces together: listing the complete script

print this article
SEARCH DEVARTICLES

JavaScript Remote Scripting: Processing XML Files
(Page 1 of 6 )

Here you have it. Welcome to the second part of the series “JavaScript Remote Scripting.” Based on the theoretical concepts explained in the first tutorial, as well as their application in an illustrative example, I’ve demonstrated how to read file data from the server by using AJAX as the primary method for making http requests in the background, without having to reload the current page.

Stepping back for a moment to the script that I previously developed in the first article, it implements a simple mechanism for fetching data from a plain text file and displaying the information through a predefined sequence. Although the example is rather basic, it does exposes the foundations of AJAX technology for building more complex and polished applications, by utilizing as core programming logic the powerful capabilities for sending silent http requests on the fly.

The best thing with this approach is that it offers a broad range of applications for fetching data from the server in multiple formats. Of course you have already seen how easy it is to fetch data from flat text files and display their contents directly on the browser, all without messing up things too much with complex server-side programs. Moreover, AJAX comes with native support for pulling out data served as XML, by using the “responseXML” property that belongs to the XMLHtttpRequest object.

Considering that XML is today one of the most common data carriers used when working with Web services, this second part of the series will put strong attention to developing a JavaScript application that fetches data from an XML file, by taking advantage of the native capabilities that AJAX brings to developers for working with this markup language. In my attempt to illustrate the relevant role of AJAX within the area of remote scripting, by the end of this article you will know the basics for using client-side parsed XML in your own applications.

Now that you know the objectives of this second part of the series, it’s time to move on to learn more about JavaScript-based XML processing. Let’s get going!


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- Project Nashorn to Make Java, JavaScript Wor...
- JavaScript Virus Attacks Tumblr Blogs
- Google Releases Stable Dart Version, JavaScr...
- Khan Academy Unveils New JavaScript Learning...
- Accessing Nitro? There`s an App for That
- JQuery 2.0 Leaving Older IE Versions Behind
- Fastest JavaScript Engine Might Surprise You
- Microsoft Adjusting Chakra for IE 10
- Brendan Eich: We Don`t Need Google Native Cl...
- An Overview of JavaScript Statements
- An Overview of JavaScript Operators
- Overview of JavaScript Variables
- More of the Top jQuery Social Plugins
- The Top jQuery Social Plugins
- More of the Top jQuery Slider Plugins

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




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