Jump to content

User:FatalError/Ajax (programming)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by FatalError (talk | contribs) at 06:04, 27 June 2008 (Advantages). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Ajax (asynchronous JavaScript and XML), or AJAX, is a group of interrelated web development techniques used for creating interactive web applications. With Ajax, web applications can retrieve data from the server asynchronously in the background without interfering with the display and behavior of the existing page. JavaScript is the scripting language in which Ajax function calls are usually made. Data is retrieved using the XMLHttpRequest object, or through the use of Remote Scripting in browsers that do not support it. In any case, it is not required that the content be formatted in XML or retrieved asynchronously.[1]

History

While the term "Ajax" was coined in 2005,[2] techniques for the asynchronous loading of content date back to 1996, when Internet Explorer introduced the IFrame element.[3] Microsoft's Remote Scripting, introduced in 1998, acted as a more elegant replacement for these techniques, with data being pulled in by a Java applet with which the client side could communicate using JavaScript. In 2002, Microsoft created the XMLHttpRequest as an ActiveX control in Internet Explorer 5, and developers of Mozilla and Safari followed soon after with native versions of the object.[4][3] On April 5, 2006, the XMLHttpRequest object became an official web standard.[5]

Advantages

  • In many cases, the pages on a website consist of much content that is common between them. Using traditional methods, that content would have to be reloaded on every request. However, using Ajax, a web application can request only the content that needs to be updated, thus drastically reducing bandwidth usage.[6][7][8]
  • Because only sections of pages need to be reloaded, Ajax allows for much more responsive web applications,[9] giving users the feeling that changes are happening instantaneously.[10]
  • The used of Ajax can reduce connections to the server, since scripts and style sheets only have to be requested once.[10]

Disadvantages

  • Dynamically created pages do not register themselves with the browser's history engine, so clicking the browser's "back" button would not return the user to an earlier state of the Ajax-enabled page, but would instead return them to the last page visited before it.[8] Workarounds include the use of invisible IFrames to trigger changes in the browser's history.[10][8]
  • Dynamic web page updates also make it difficult for a user to bookmark a particular state of the application. Solutions to this problem exist, many of which use the URL fragment identifier (the portion of a URL after the '#') to keep track of, and allow users to return to, the application in a given state.[10][8]
  • Because most web crawlers do not execute JavaScript code, web applications should provide an alternative means of accessing the content that would normally be retrieved with Ajax, to allow search engines to index it.[11]

Accessibility

Non-Ajax users would ideally continue to load and manipulate the whole page as a fall back, enabling 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.[clarification needed] For this reason it is advised to first develop a full application without Ajax, and implement Ajax enhancements as an addition only (see: Progressive enhancement methodology).[citation needed] The same counts for JavaScript in general, which can be disabled in most browsers.

Because many people[weasel words] consider it unreasonable to advise against the use of JavaScript in modern web applications, the W3C Web Accessibility Initiative (WAI) is working on a specification for Accessible Rich Internet Applications (ARIA). In effect, ARIA allows web pages, or portions of web pages, to declare themselves as applications rather than as documents. This allows Ajax interactions and other types of JavaScript-enabled UI controls to interact with assistive technology, like screen readers for the vision-impaired.

One early user agent implementation is Firefox 3, which maps WAI-ARIA to the accessibility API of the underlying operating system, making it possible for screen readers to treat ARIA widgets in much the same way as the widgets found in client-side software. Another early implementation is Fire Vox, an extension that turns Firefox into a self-voicing browser. Since Fire Vox operates directly on the DOM and does not use the operating system's accessibility API, it can handle WAI-ARIA features, such as live regions, which have no mapping to traditional desktop applications.

Ajax libraries and toolkits are also adopting ARIA. Notable examples include Google Web Toolkit, Backbase and Dojo Toolkit.[citation needed] In addition, AxsJAX, a JavaScript library which focuses on web-application accessibility, includes several abstractions built on top of ARIA.

See also

References

  1. ^ Ullman, Chris. "What is Ajax?". wrox.com. Retrieved 2008-06-24.
  2. ^ Jesse James Garrett (2005-02-18). "Ajax: A New Approach to Web Applications". adaptivepath.com. Retrieved 2008-06-19.
  3. ^ a b Wei, Coach (2008-05-19). "A Brief History of AJAX". Real-World AJAX. AjaxWorld Magazine. Retrieved 2008-06-24. {{cite web}}: Unknown parameter |coauthors= ignored (|author= suggested) (help)
  4. ^ "Dynamic HTML and XML: The XMLHttpRequest Object". Apple Inc. Retrieved 2008-06-25.
  5. ^ "The XMLHttpRequest Object". World Wide Web Consortium. 2006-04-05. Retrieved 2008-06-25.
  6. ^ Merrill, Christopher (2006-01-15). "Performance Impacts of AJAX Development". Web Performance, Inc. Retrieved 2008-06-16.
  7. ^ "The Advantages of Using AJAX". lunarpages.com. Retrieved 2008-06-26.
  8. ^ a b c d "Advantages and Disadvantages of Ajax". Exforsys Inc. Retrieved 2008-06-26.
  9. ^ Wroblewski, Luke. "AJAX & Interface Design". LukeW.com. Retrieved 2008-06-26.
  10. ^ a b c d "Why use AJAX?". InterAKT. 2005-11-10. Retrieved 2008-06-26.
  11. ^ "The Disadvantages of Using AJAX". lunarpages.com. Retrieved 2008-06-26.