Printer Friendly
The Free Library
4,719,278 articles and books
Member login
User name  
Password 
 
Join us Forgot password?

Programming Ajax.


Asynchronous Refers to events that are not synchronized, or coordinated, in time. The following are considered asynchronous operations. The interval between transmitting A and B is not the same as between B and C. The ability to initiate a transmission at either end.  JavaScript And XML XML
 in full Extensible Markup Language.

Markup language developed to be a simplified and more structural version of SGML. It incorporates features of HTML (e.g., hypertext linking), but is designed to overcome some of HTML's limitations.
, or its acronym Ajax, is a Web development technique for creating interactive web applications. The intent is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire Web page does not have to be reloaded each time the user makes a change. This is meant to increase the Web page's interactivity, speed, and usability.

The Ajax technique uses a combination of:

* XHTML (EXtensible HTML) A markup language for Web pages from the W3C. XHTML combines HTML and XML into a single format (HTML 4.0 and XML 1.0). Like XML, XHTML can be extended with proprietary tags. Also like XML, XHTML must be coded more rigorously than HTML.  (or HTML HTML
 in full HyperText Markup Language

Markup language derived from SGML that is used to prepare hypertext documents. Relatively easy for nonprogrammers to master, HTML is the language used for documents on the World Wide Web.
), CSS (1) See Cascading Style Sheets.

(2) (Content Scrambling System) The copy protection system applied to DVDs, which uses a 40-bit key to encrypt the movie.
, for marking up and styling information.

* The DOM accessed with a client-side scripting Client-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side (on the web server).  language, especially ECMAScript implementations like JavaScript and JScript, to dynamically display and interact with the information presented.

* The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in some situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server.

* XML is commonly used as the format for transferring data back from the server, although any format will work, including preformatted HTML, plain text, JSON (JavaScript Object Notation) A text-based data interchange format designed for use between programming languages. A subset of JavaScript and pronounced "jay  and even EBML EBML Extensible Binary Meta Language
EBML Echo Bay Mines Limited
. Like DHTML See Dynamic HTML.

DHTML - Dynamic HTML
, LAMP, or SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies together. In fact, derivative/composite technologies based substantially upon Ajax, such as AFLAX, are already appearing.

History

Most histories of Ajax start with Microsoft's initiatives in developing Remote Scripting Remote Scripting is a technology which allows scripts running inside a browser to exchange information with a server. The local scripts can invoke scripts on the remote side and process the returned information. . However, remote scripting was actually first introduced by Netscape in 1997 as part of its layer specification for the Netscape Communicator An earlier suite of Web browsing and groupware tools from Netscape that were packaged as a bundle starting with Navigator 4.0. Communicator refers to any Netscape Navigator product with a version number less than 6.0.  browser, Netscape 4.0. An early example of this technique is Valley of the Nile [1] (http://worldwideworlds.com/) an Ajax visual chat environment designed for Netscape 4.0 in 1997.

As documented in Netscape's specification of layer for Javascript 1.2 [2] (http://docs.sun.com/source/816-6408-10/layer.htm), the tag had an src attribute that could take any external URL URL
 in full Uniform Resource Locator

Address of a resource on the Internet. The resource can be any type of file stored on a server, such as a Web page, a text file, a graphics file, or an application program.
, enabling asynchronous loading of content on an existing web page without requiring a full reload (1) To load a program from disk into memory once again in order to run it. Reload is entirely different than reinstall. Reinstall means that you have to run the install program from a CD-ROM or floppy disk and perform the installation procedure over again. . At the time Netscape introduced layer, Microsoft was readying Internet Explorer Microsoft's Web browser, which comes with Windows starting with Windows 98. Commonly called "IE," versions for Mac and Unix are also available. Internet Explorer is the most widely used Web browser on the market. It has also been the browser engine in AOL's Internet access software.  4.0, which implemented a totally different and incompatible document object model (DOM).

Microsoft's DOM relied on a new method, document. all, which was similar to the getElementById method that became part of the planned W3C (World Wide Web Consortium, www.w3.org) An international industry consortium founded in 1994 by Tim Berners-Lee to develop standards for the Web. It is hosted in the U.S. by the Computer Science and Artificial Intelligence Laboratory (CSAIL) at MIT (www.csail.mit.edu/index.php).  DOM in 1998. This divergence in Javascript coincided with the beginning of Internet Explorer's ascendancy during the browser wars. As IE gained dominance, Netscape's influence on Javascript began to wane, and the layer tag was not accepted by developers who were struggling to write cross-browser DHTML to satisfy both Netscape and IE, each with about half of the market by 1999. By 2000, it was clear Netscape had lost the browser wars, and so layer fell out of use. As a consequence, most developers never bothered to learn or utilize the layer src method, and it took many years for remote scripting and DHTML--the combination that we now call Ajax--to once again come to the attention of developers as a tool for enhancing user interfaces for web applications.

After essentially killing off the Netscape remote scripting approach, Microsoft developed its own form of Remote Scripting, initially to support development of its web interface for Outlook. Microsoft's early form used a dedicated Java applet, preceding development of the XMLHttpRequest method that is used in Ajax applications today.

The web development community, first collaborating via the microsoft.public.scripting.remote newsgroup newsgroup

Internet forum for discussion of specific subjects. Newsgroups are organized into subjects (e.g., automobiles); each typically has several subgroups (e.g., classic cars, Formula One racing cars).
 and later through blog aggregation, subsequently developed a range of techniques for remote scripting in order to enable consistent results across different browsers. Early examples are the IFRAME-based JSRS JSRS Javascript Remote Scripting
JSRS Japan Spine Research Society
JSRS Judges and Solicitors Retirement System
 (http://www.ashleyit.com/rs/jsrs/test.htm) library from 2000, the introduction of the Image/Cookie (http://www.depressedpress.com/Content/Development/JavaScript/Articles/GIFAsPipe/Index.cfm) technique in 2000, and the JavaScript on Demand (http://dotvoid.com/view.php?id=13) technique in 2002.

In 2002, a user-community modification(http://groups.google.ca/group/microsoft.public.scripting.remote/browse_thread/thread/99b7e6152b45b2e7/6b368) to Microsoft Remote Scripting was made to replace the Java applet with XMLHttpRequest.

Remote Scripting Frameworks such as ARSCIF ARSCIF Asynchronous Remote Script Callback Invocation  (http://arscif.dsi.unimi.it/) surfaced in 2003 not long before Microsoft introduced Callbacks in ASP.NET (http://msdn.microsoft.com/msdnmag/issues/04/08/CuttingEdge/)

Some early articles promoting Remote Scripting techniques:

* Microsoft Internet Developer Magazine (http://www.microsoft.com/mind/0498/cutting0498.asp) 1998

* ScottAndrew's XML-RPC (XML Remote Procedure Call) A message-based protocol based on XML for accessing services over the Internet. An XML-RPC message is passed to the target server in an HTTP POST request. For more information, visit www.xml-rpc.com. See XMLP, XML and RPC.  example (http://www.scottandrew.com/xml-rpc/) 2001

* Apple Developer Connection The Apple Developer Connection, or ADC, is Apple Computer's developer network. It is designed to make available resources to help software developers write software for the Apple Mac OS X platform.  (http://developer.apple.com/intemet/webcontent/iframe.html) 2002.

* Using the XML HTTP Request object (http://jibbering.eom/2002/4/httprequest.html) 2002-2006

Since XMLHttpRequest is now implemented across the majority of browsers in use, alternative techniques are used infrequently. However, they are still used where wide compatibility, small implementation, or cross-site access are required. One alternative, the SVGT (SVG Tiny) See SVG.  protocol (http://networkimprov.net/airwrx/awscene.html), employs a persistent connection for continuous exchange between browser and service.

Pros, cons and criticism

Pros

Interactivity

Ajax applications are mainly executed on the user's machine, by manipulating the current page within their browser using document object model methods. Ajax can be used for a multitude of tasks such as updating or deleting records; expanding web forms; returning simple search queries; or editing category trees--all without the requirement to fetch a full page of HTML each time a change is made. Generally only small requests are required to be sent to the server, and relatively short responses are sent back. This permits the development of more interactive applications featuring more responsive user interfaces due to the use of DHTML techniques.

Portability

Ajax applications use well-documented features present in all major browsers on most existing platforms. Though this situation could feasibly change in the future, at the moment, Ajax applications are effectively cross-platform.

While the Ajax platform is more restricted than the Java platform, current Ajax applications effectively fill part of the one-time niche of Java applets: extending the browser with lightweight mini-applications.

Cons and criticism

Usability criticisms

One major complaint voiced against the use of Ajax in web applications is that it might easily break the expected behavior of the browser's back button (see Jakob Nielsen's 1999 Top-10 New Mistakes of Web Design (http://www.useit.com/alertbox/990530html)).

The different expectations between returning to a page which has been modified dynamically versus the return to a previous static page might be a subtle one. Users generally expect that clicking the back button in web applications will undo their last state change and in Ajax applications this might not be the case. Developers have implemented various solutions to this problem, most of which revolve around creating or using invisible IFRAMEs to invoke changes that populate the history used by a browser's back button.

Google Maps, for example, performs searches in an invisible IFRAME and then pulls results back into an element on the visible web page; it is possible to track user behaviour via callbacks which are called whenever the back button is pressed, restoring the application state that existed A related issue is that the use of dynamic web page A Web page that is returned to the user with custom content based on the results of a search or some other request. Also known as "dynamic HTML" or "dynamic content," the "dynamic" word is used with Web sites to refer to custom results individualized to each user in contrast to the  updates makes it difficult for a user to bookmark A stored location for quick retrieval at a later date. Web browsers provide bookmarks that contain the addresses (URLs) of favorite sites. Most electronic references, large text databases and help systems provide bookmarks that mark a location users want to revisit in the future.  a particular state of the application. Solutions to this problem have likewise begun to appear, many of which use the URL fragment identifier (commonly known as the anchor, or the portion of the URL after the '#') to keep track of, and allow users to return to, the application in a given state. (Many browsers allow JavaScript scripts to update the anchor dynamically, which allows the Ajax application to update it in parallel with the contents of the display.) These solutions also address many of the issues related to lack of back button support.

Usually overlooked, WAI WAI Web Accessibility Initiative (W3C)
WAI Where Am I?
WAI Wales Arts International (UK)
WAI Women in Aviation, International
WAI Warm Air Intake
WAI Web Application Interface
 is a concern. Most developers do not implement AJAX in a WAI-compatible manner.

Response-time concerns

Network latency--or the interval between user request and server response--needs to be considered carefully during Ajax development. Without clear feedback to the user [3] (http://www.xml.eom/pub/a/2005/08/22/ajax.html), smart preloading of data [4] (http://www.jonathanboutelle.com/mt/archives/2004/08/latency_must_di.html), and proper handling of the XMLHttpRequest object [5] (http://ajaxblog.com/archives/2005/06/01/async-requests-over-an-unreliable-network) users might experience delay in the interface of the web application, something which users might not expect or understand. [6] (http://www.lastcraft.com/blog/index.php?p=19) The use of visual feedback to alert the user of background activity and/or preloading of content and data are often suggested solutions to these latency issues.

In general the potential impact of latency has not been "solved" by any of the Public Domain AJAX toolkits and frameworks available today, such as the effect of latency variance over time [7] (http://www.sitepomt.comMogs/2006/02/10/ajaxlocamost/).

JavaScript

While no browser plug-in is required for Ajax, it requires users to have JavaScript enabled in their browsers. This applies to all browsers that support Ajax except for Microsoft Internet Explorer See Internet Explorer.  6 and below which additionally requires ActiveX to be enabled along with ActiveScript. The XMLHTTPRequest object used in Internet Explorer is ActiveX. Security settings might cause Internet Explorer to not support Ajax (e.g.: ActiveScript or ActiveX might be disabled). It is possible to use inline frames (IFRAMEs) to avoid this ActiveX problem. Internet Explorer 7, however, exposes XMLHTTP object in the native browser API and hence does not need ActiveX to render AJAX sites.

As with DHTML applications, Ajax applications must be tested rigorously to deal with the quirks of different browsers and platforms. A number of programming libraries have become available as Ajax has matured that can help ease this task. Likewise, techniques have been developed to assist in designing applications which degrade gracefully and offer alternative functionality for users without JavaScript enabled.

Name issues

There have been some critics of the term Ajax, claiming that Adaptive Path (http://www.adaptivepath.com/) (the consulting firm that coined the term [8] (http://news.com.com/2061-10798_3-5630188.html)) or other proponents are using it as a marketing vehicle for previously-used techniques [9] (http://www.25hoursaday.com/weblog/PermaLink.aspx?guid=018ea507-4a62-4493-b01b-321e3672d725) [10] (http://www.fiftyfoureleven.com/weblog/news-rants-and-ephemera/on-ajax-and-marketing-technologies) [11] (http://developers.slashdot.org/article.pl?sid=05/02/23/1859222&tid=189&tid=95&tid=217&tid=8) [12] (http://ln.hixie.ch/?start=1 111339822&coun1^1).

Accessibility

Using Ajax technologies in web applications provides many challenges for developers interested in adhering to WAI accessibility guidelines. Developers need to provide fallback fall·back  
n.
1.
a. Something to which one can resort or retreat.

b. A retreat.

2. Computer Science
 options for users on other platforms or browsers, as most methods of Ajax implementation rely on features only present in desktop graphical browsers.

Web developers use Ajax in some instances to provide content only to specific portions of a web page, allowing data manipulation without incurring the cost of re-rendering the entire page in the web browser The program that serves as your front end to the Web on the Internet. In order to view a site, you type its address (URL) into the browser's Location field; for example, www.computerlanguage.com, and the home page of that site is downloaded to you. . Non-Ajax users would optimally continue to load and manipulate the whole page as a fallback, allowing the developers to preserve the experience of users in non-Ajax environments (including all relevant accessibility concerns) while giving those with capable browsers a much more responsive experience.

Markup language vs programming

The common approach to apply Ajax usually involves extensive programming in JavaScript. Frameworks are then aimed to provide ready-to-use UI (e.g., in HTML or XUL (EXtensible User Interface Language) A set of XML tags for describing graphical user interfaces. Designed for cross-platform porting and derived from the Mozilla open source project, XUL supports the following Web functions: cascading style sheets (CSSs) for styles, ) widgets and libraries to make programming in JavaScript easier.

The major advantage of the declarative de·clar·a·tive  
adj.
1. Serving to declare or state.

2. Of, relating to, or being an element or construction used to make a statement: a declarative sentence.

n.
 approach is that non-programmers are allowed to define user interfaces with HTML-like markup language. The disadvantage is that pages are becoming harder and more obscure to design and maintain, as it becomes more sophisticated.

Browsers that support Ajax

(Note that this is a general list, and support of Ajax applications will depend on the features the browser supports.)

* Microsoft Internet Explorer version 5.0 and above, and browsers based on it (Mac OS versions not supported)

* Gecko-based browsers like Mozilla, Mozilla Firefox, SeaMonkey, Epiphany (web browser), Galeon andNetscape version 7.1 and above

* Browsers implementing the KHTML KHTML Konqueror Hyper Text Markup Language
KHTML Kde Html
 API version 3.2 and above, including Konqueror version 3.2 and above, and Apple Safari version 1.2 and above

* Opera browsers version 8.0 and above, including Opera Mobile Browser version 8.0 and above

* ICab version 3.0b352 and above

Browsers that do not support Ajax

This is a list of browsers that definitely do not support Ajax

* Opera 7 and below

* Microsoft Internet Explorer 4.0 and below

* Text-based browsers like Lynx and Links

* Browsers for the visually impaired (speech-synthesising, braille)

* Browsers made before 1997

See also

* Rich Internet Application See RIA and rich client.  

* Single Page Application

* Client/SOA

* Progressive Enhancement

* Graceful degradation

* Open Ajax

* AjaXSLT

External links--Articles

* Ajax: A New Approach to Web Applications (http://www.adaptivepath.com/publications/essays/archives/000385.php), by Jesse James Garrett Jesse James Garrett is an information architect and founder of Adaptive Path, an information architecture and user experience firm. Garrett co-founded the Information Architecture Institute, and his essays have appeared in New Architect, Boxes and Arrows, and . The original article which coined the term.

* Why Ajax Matters Now (http://www.ok-cancel.com/archives/article/2005/09/whyajax-matters-now.html)

by Jesse James Garrett.

* Weighing the Alternatives (http://www.ajaxinfo.com/default~viewart~8.htm) How Ajax stacks up against competing RIA (Rich Internet Application) A Web-based application that approaches the speed and elegance of a local application. An RIA may refer to a browser-based application that uses AJAX or another enhanced coding technique.  approaches.
COPYRIGHT 2006 A.P. Publications Ltd.
No portion of this article can be reproduced without the express written permission from the copyright holder.
Copyright 2006, Gale Group. All rights reserved. Gale Group is a Thomson Corporation Company.

 Reader Opinion

Title:

Comment:



 

Article Details
Printer friendly Cite/link Email Feedback
Title Annotation:SOFTWARE INTELLIGENCE
Publication:Software World
Geographic Code:1USA
Date:Mar 1, 2006
Words:2158
Previous Article:MT-Podcast removes human voice from podcasts.(new product from MagneticTime)(Brief article)
Next Article:Anycast.(DEFINITION)
Topics:



Related Articles
New journals from Sys-Con Media and Thomas Communications.
Ajax for beginners.(SOFTWARE INTELLIGENCE)
Sitestat V5 based on AJAX.(Brief article)
JAVA DEVELOPERS DEVELOP APPLICATIONS AT NOT COST.
"Ajax Hacks".(IT News)
IT news and products; InterSystems introduces CACHE 2007.(SOFTWARE WORLD DIGEST)
Ajax on Rails.
Ajax on Rails.
Microsoft to take on AJAX with Atlas.(IT News)
What you should know about R on R and AJAX.(DEFINITIONS)

Terms of use | Copyright © 2009 Farlex, Inc. | Feedback | For webmasters | Submit articles