Chapter 13. Moving Outside the Page with Ajax


Some consider it the next best Web; others consider it hype. Whatever the opinion, Ajax, or AJAX (Asynchronous JavaScript And XML), as some prefer, has led to a greater interest in JavaScript in general and dynamic JavaScript functionality specifically.

For all the shiny newness of the interest, none of the technologies associated with Ajax are new. It's dependent on JavaScript, which has been around since the mid-90s. It's also dependent on the Document Object Model; standard web technologies such as CSS, XHTML, and XML; and the XMLHttpRequest object, all of which were introduced years before the term Ajax was coined.

What is new is the fact that a concept was introduced for a type of development, coinciding with newer browsers, all of which enable the necessary functionality. In other words, the time was ready for the technology; all that was needed was someone to notice, package it, and promote its use. That someone was Jesse James Garrett in his publication, "Ajax: A New Approach to Web Applications" (at http://www.adaptivepath.com/publications/essays/archives/000385.php).

Where the Ajax examples in this chapter differ from examples in previous chapters is that Ajax does require a server component. Ruby is a popular choice of programming language for Ajax development, but any server-side language that can process the specialized Ajax requests will work. The examples in this chapter use PHP, primarily because of all the languages, it's most similar to JavaScript, as well as being one of the most common server-side scripting languages in use. In Chapter 14, we'll take a look at Ruby and Ajax libraries.

AJAX? Or Ajax? When Garrett introduced the concept, he used Ajax. If Ajax is an acronym, it should then be AJAX. Or perhaps, more accurately, AJaX. However, Garrett introduced the term as a nickname, not an acronym, and the acronym appeared later as people tried to figure out what led to the name.

There is no right or wrong choicethey're all just termsand since the popular use is Ajax, I'll use this for the rest of the book. Besides, it's easier than having to hold down the Shift key every time I type the word.





Learning JavaScript
Learning JavaScript, 2nd Edition
ISBN: 0596521871
EAN: 2147483647
Year: 2006
Pages: 151

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net