Suite101

Beginning AJAX and Web XML

A Pragmatic Primer for Professional Web Developers

© Guy Lecky-Thompson

Aug 30, 2007
AJAX and XML for Web Developers explained in a pragmatic primer for beginning and experienced professional web developers.

Introduction

With more and more web surfers expecting a high level of interactivity and customization to their web experience, new techniques have come to the fore to help professional web developers deliver highly tuned and effective services. Part of helping them to put interactive web pages together is the coupling of several existing technologies under the banner of an AJAX deployment.

What is AJAX?

First and foremost : AJAX is not a new language, tool, package or solution. It is a reworking of a number of existing standards to fit the changing needs of web users. Essentially, it is a combination of:

  • HTML : for layout and interface
  • XML : for structured communication
  • JavaScript : to facilitate decision making & programming
  • PHP/ASP : for server-side processing

In the DHTML layered model, AJAX can be viewed as an HTML front-end, some browser side logic implemented in JavaScript that communicates with the server using structured XML requests and responses, which in turn processes the information using a server-side scripting language. The important point is that the surfer has no need to know that the page uses AJAX technology at all; indeed, it should be absolutely seamless.

For those still wondering - AJAX = Asynchronous JavaScript and XML. The key to the power and use of AJAX is in the name - it is asynchronous, and therefore does not rely on a sequential loading pattern like typical web forms. Instead, communication and updates can happen in an ad-hoc fashion.

What do I need to use AJAX?

In order to be abel to use AJAX techniques, the professional web developer need no more that they probably already have:

  • A web server with server-side scripting
  • A web browser supporting JavaScript

Either a PHP or ASP aware server will cope equally well, and most browsers support the required XML abstractions in JavaScript. Internet Explorer uses an ActiveX control, while other browsers use a built-in JavaScript object. The developer will need to develop code to select between the two abstractions, as they are not compatible.

Aside from this slight foible, the implementations under IE, other browsers (such as Firefox), PHP and ASP are more or less equivalent.

What do I need to know to use AJAX?

The developer needs to have a working knowledge of HTML forms, XML, JavaScript and one of the supported web server scripting languages, PHP or ASP. The XML knowledge can be gained as part of the AJAX learning experience, but the other technologies are a pre-requisite. In particular, the developer must have good knowledge of using JavaScript for HTML form validation and interception, as well as some experience writing applications that require communication between a server side scripting language and web browser.

What can I do with AJAX?

AJAX exists to allow the developer to build a high level of interactivity into web pages. For example, Google Suggest uses AJAX to automatically propose possible search terms. Any AJAX aware page can use data provided by the user, or pulled from third party sources (such as RSS), to communicate with it's own server, and provide enhanced, enriched, or interactive content.

Further Reading

  • Getting Started with JavaScript
  • Programming for the World Wide Web
  • PHP Programming with HTML Documents

  • The copyright of the article Beginning AJAX and Web XML in AJAX Programming is owned by Guy Lecky-Thompson. Permission to republish Beginning AJAX and Web XML in print or online must be granted by the author in writing.




    Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo