Glossary of Computer Science and Engineering Part 4 - AJAX | HackTHatCORE
AJAX (Asynchronous Javascript and XML)
With the tremendous growth in Web usage comes a challenge to deliver Web-page content more efficiently and with greater flexibility. This is desirable to serve adequately the many users who still rely on relatively low-speed dial-up Internet connections and to reduce the demand on Web servers. Ajax (asynchronous JavaScript and XML) takes advantage of several emerging Web-development technologies to allow Web pages to interact with users while keeping the amount of data to be transmitted to a minimum. In keeping with modern Web-design principles, the organization of the Web page is managed by coding in XHTML, a dialect of HTML that uses the stricter rules and grammar of the data-description markup language XML (see html , dhtml , and xhtml and xml ). Alternatively, data can be stored directly in XML. A structure called the DOM (Document Object Model; see dom ) is used to request data from the server, which is accessed through an object called httpRequest. The “presentational” information (regarding such matters as fonts, font sizes and styles, justification of paragraphs, and so on) is generally incorporated in an associated cascading style sheet (see cascading style sheets ).
Behavior such as the presentation and processing of forms or user controls is usually handled by a scripting language (for example, see J ava S cript ). Ajax techniques tie these forms of processing together so that only the part of the Web page affected by current user activity needs to be updated. Only a small amount of data needs to be received from the server, while most of the HTML code needed to update the page is generated on the client side—that is, in the Web browser. Besides making Web pages more flexible and interactive, Ajax also makes it much easier to develop more elaborate applications, even delivering fully functional applications such as word processing and spreadsheets over the Web (see application service provider ). Some critics of Ajax have decried its reliance on JavaScript, arguing that the language has a hard-to-use syntax similar to the C language and poorly implements objects (see object - oriented programming ). There is also a need to standardize behavior across the popular Web browsers. Nevertheless, Ajax has rapidly caught on in the Web development community, filling bookstore shelves with books on applying Ajax techniques to a variety of other languages (see, for example, php ). Ajax can be simplified by providing a framework of objects and methods that the programmer can use to set up and manage the connections between server and browser.
Some frameworks simply provide a set of data structures and functions (see application program interface ), while others include Ajax-enabled user interface components such as buttons or window tabs. Ajax frameworks also vary in how much of the processing is done on the server and how much is done on the client (browser) side. Ajax frameworks are most commonly used with JavaScript, but also exist for Java (Google Web Toolkit), PHP, C++, and Python as well as other scripting languages. An interesting example is Flapjax, a project developed by researchers at Brown University. Flapjax is a complete high-level programming language that uses the same syntax as the popular JavaScript but hides the messy details of sharing and updating data between client and server.
Drawbacks and Challenges
By their very nature, Ajax-delivered pages behave differently from conventional Web pages. Because the updated page is not downloaded as such from the server, the browser cannot record it in its “history” and allow the user to click the “back” button to return to a previous page. Mechanisms for counting the number of page views can also fail. As a workaround, programmers have sometimes created “invisible” pages that are used to make the desired history entries. Another problem is that since content manipulated using Ajax is not stored in discrete pages with identifiable URLs, conventional search engines cannot read and index it, so a copy of the data must be provided on a conventional page for indexing. The extent to which XML should be used in place of more compact data representations is also a concern for many developers. Finally, accessibility tools (see disabled persons and computers ) often do not work with Ajax-delivered content, so an alternative form must often be provided to comply with accessibility guidelines or regulations. Despite these concerns, Ajax is in widespread use and can be seen in action in many popular Web sites, including Google Maps and the photo-sharing site Flickr.com.
References:
- Ajaxian [news and resources for Ajax developers]. Available online. URL: http://ajaxian.com/. Accessed April 10, 2007.
- Crane, David, Eric Pascarello, and Darren James. Ajax in Action. Greenwich, Conn.: Manning Publications, 2006.
- “Google Web Toolkit: Build AJAX Apps in the Java Language.” Available online. URL: http://code.google.com/webtoolkit/. Accessed April 10, 2007.
- Holzner, Steve. Ajax for Dummies. Hoboken, N.J.: Wiley, 2006. Jacobs, Sas. Beginning XML with DOM and Ajax: From Novice to Professional. Berkeley, Calif.: Apress, 2006.
Comments
Post a Comment