JavaScript Remote Scripting: Fetching Server Data with the DOM
(Page 1 of 5 )
This article provides you with a handy method for making JavaScript-based requests to the server and serving XML documents, all without the need to use AJAX technology. If you’re inclined to work very close to W3C standards, this is an approach worth considering, since it allows the implementation of Web services through a cross-domain integration.
Welcome to part three of the series “JavaScript Remote Scripting.” Comprised of several parts, this tutorial introduces different methods of utilizing remote scripting on web-based applications, explaining the benefits and exploring different ways of implementation.
Returning to part two of this series, I demonstrated with an introductory example how you can read, process and display XML data, by using the already popular AJAX technology. As you know, JavaScript-based asynchronous http requests make it really easy to fetch data from the server, which has been structured as XML, for parsing in the client. Indeed, one of the most significant benefits of using AJAX for making requests in the background is the vast range of possibilities for processing data.
Either you’re developing an application that accepts raw data from the server for processing in the client –- generally through the DOM or the XML DOM, when applicable -- or setting up a Web service that does the hard processing on the server before sending data to the client. There are a plethora of development possibilities.
It’s precisely for that reason that I’ll continue exploring different methods for implementing remote scripting in Web programs. In particular, this part of the series will be aimed at explaining how to read and process XML data without the need to use AJAX as the primary technology for sending http requests. Of course, the best thing about JavaScript-based requests is that they can be performed using only fully-W3C DOM standard methods, which certainly leads to using an approach that’s much closer to standardization.
Now that you have a clear idea about the topics to be treated in this article, it’s time to go further into the implementation of standard DOM methods for fetching data from the server. Let’s get started!
Next: One step toward standardization: making http requests with the DOM >>
More JavaScript Articles
More By Alejandro Gervasio