If you've been involved in Web development for any amount of time, the latest trend of developing applications with remote scripting capabilities via AJAX (Asynchronous JavaScript + XML) will not be a surprise. After all, it has been available for many years with the drawback being browser inconsistencies. Microsoft always promoted ActiveX as the way to go, but this approach has changed with AJAX's rise in popularity. Let's take a closer look at the AJAX revolution, including Microsoft's involvement and approach.

What is AJAX?
Defining AJAX is not as simple as pointing to a W3C page because it is a collection of technologies. It combines the following:

  • Standards-based presentation layer utilising XHTML and CSS
  • The DOM (Document Object Model) is used for dynamic display and user interaction
  • Asynchronous data retrieval via XMLHttpRequest XML and XSLT allow data interchange and manipulation
  • JavaScript is used to tie everything together

The big difference between the AJAX approach and traditional Web development is remote scripting. Remote scripting allows client-side JavaScript to request data from a server without refreshing the Web page. This is accomplished via JavaScript and the XMLHttpRequest object. Remote scripting moves some of the processing to the client (browser), which greatly reduces the number of calls to the Web server.

Microsoft first implemented the XMLHttpRequest object in Internet Explorer 5 for Windows as an ActiveX object. Outlook Web Access was first developed with this ActiveX component. Engineers on the Mozilla project implemented a compatible native version for Mozilla 1.0 (and Netscape 7) with Apple adding support in their Safari 1.2 browser. Similar functionality is covered in a proposed W3C standard. In the meantime, the XMLHttpRequest object has become a de facto standard.

A middle man
A traditional Web application triggers a call to the HTTP server for a user action or request. In turn, the server performs some tasks and returns an HTML page to the requesting client. It is a disconnected user experience, where the user is left waiting much of the time while the server requests finish.

AJAX applications eliminate the start-stop-start-stop nature of Web interactions by introducing an intermediary between the user and the server. The client browser loads the AJAX engine upon the start of a session. The AJAX engine is written in JavaScript and is usually tucked away in a hidden frame. It is responsible for both rendering the user interface and communicating with the server. The AJAX engine allows the user's interaction with the application to happen asynchronously independent of communication with the Web server.

AJAX in action
The AJAX approach is appealing to major companies like Google and Amazon. Google has used the AJAX approach extensively in the development of its Gmail, Google Suggest, and Google Maps Web applications. (Actually, Google has made a huge investment in AJAX in all of its major recently developed or enhanced products.) Likewise, Amazon followed a similar course with its A9 search engine. There are many more examples available every day.

Microsoft's AJAX
Of course, Microsoft is at work to develop a better AJAX. Atlas is the codename for their upcoming AJAX support. It goes well beyond the original concept, including integrated debugging with Visual Studio. In addition, new ASP.NET server controls will be available to easily bind client-side controls to server-side code. The Atlas Client Script Framework will make it easy to interact with pages and such. However, it will not be available in Visual Studio 2005.

Microsoft recently announced that the Atlas Client Script Framework will include the following components (as detailed on the Atlas project site):

  • Extensible core framework adding features to JavaScript such as lifetime management, inheritance, multicast event handlers, and interfaces.
  • Base class library for common features such as rich string manipulation, timers, and running tasks.
  • User interface framework for attaching dynamic behaviours to HTML.
  • A network stack simplifying server connectivity and Web service access.
  • A set of controls for rich user interface development -- such as auto-complete textboxes, animation, and drag-and-drop.
  • A browser compatibility layer addressing browser scripting behaviour differences.
These announcements are preliminary, so they can easily change before the actual product is released. If you can't wait for Microsoft, the freely available Ajax.NET library for the Microsoft .NET Framework is available now.

Drawbacks to AJAX
The AJAX approach requires users to have JavaScript enabled in their browser. While this should not be a major problem, it is a consideration. Likewise, these applications have to be tested rigorously to deal with the quirks of different browsers and platforms; however, this is already the case with any browser-based application not contained within an Intranet where the target browser can be controlled.

One complaint about the AJAX approach centers on it disabling the proper function of the browser's Back button since the dynamic update of a page is not recognised by the browser as going to a different page. There are many workarounds for this problem with an IFRAME's often utilised approach (Google Maps uses this approach).

One last criticism that I find amusing is people claiming AJAX is just a new term introduced as a marketing vehicle for older technologies. While this may be true, at least the included technologies are mature and tested.

New twist on an old approach
The AJAX approach to Web development is not new, but the broad support by all major browsers does make it more accessible and applicable to the Web development community at large. The technologies utilised in AJAX are mature and stable. It allows you to develop rich applications that require less server roundtrips, so the user spends less time waiting.

Do you need help with AJAX? Gain advice from Builder AU forums

Related links

Comments

1

test - 05/10/05

2

twodogs - 18/10/05

Good old Microsoft always making everything better. If they only ever had an original thought maybe someone could make something of theirs better.

» Report offensive content

3

r - 12/11/05

Check out Zimbra collaboration email service(www.zimbra.com)... its fulll of AJAX and leads the way of AJAX development in the silicon valley

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

3

r - 11/12/05

Check out Zimbra collaboration email service(www.zimbra.com)... its fulll of AJAX and leads the way of AJAX development in the silicon valley ... more

2

twodogs - 18/10/05

Good old Microsoft always making everything better. If they only ever had an original thought maybe someone could make something of ... more

1

test - 10/05/05

test ... more

Log in


Sign up | Forgot your password?

  • Staff Aussies to pay more for Win 7

    If you are looking to make some money in these troubled times, perhaps importing copies of Windows 7 could be for you. Read more »

    -- posted by Staff

  • Staff Firefox: Greens want it, 3.5rc2 not up to par

    This week's roundup looks at the situation surrounding a campaign to change Outlook HTML renderer, a Greens MP wants to install Firefox but is restricted and all the photos from the iPhone 3GS launch. Read more »

    -- posted by Staff

  • Chris Duckett Microsoft misses the Outlook point

    Ask designers which mail program is the bane of their existence, and you'll find that Outlook tops the list. The reason why the most popular email reader is also the most painful is simple: it uses Word to render HTML emails. Read more »

    -- posted by Chris Duckett

What's on?