- What is Ajax?
- Fundamental Ajax
- Adding Ajax Elements to Earlier Projects
- For More Information
For More Information
The information in this chapter barely scratches the surface of creating Ajax-enabled applications. A new book, Sams Teach Yourself Ajax, JavaScript, and PHP All in One, discusses all the information in this chapter (and then some) in much greater detail and would be a logical next step after getting your feet wet in this chapter. There are also numerous websites devoted to all or part of the technologies that make up Ajax applications, as well as third-party code libraries that will enable you to move forward in your development processes without having to reinvent the wheel, so to speak.
Learning More about the Document Object Model (DOM)
Although this book covers server-side programming with PHP, and using MySQL as the relational database that powers dynamic applications, it does not cover anything on the client-side, such as XHTML, CSS, JavaScript, and the Document Object Model (DOM). If you are unfamiliar with the DOM, this would be the primary subject to tackle while increasing your knowledgebase in anticipation of developing full-fledged Ajax applications.
Many, if not all, of your Ajax applications will use JavaScript to manipulate the DOM. Whether you are working with display elements, browser history, or window locations, a thorough understanding of the objects and properties available through the DOM is crucial to producing the streamlined user experience that is the goal of Ajax applications.
The following sites contain a plethora of good information for learning about the DOM:
- The W3C technical reports on the Document Object Model, at http://www.w3.org/DOM/DOMTR
- The home of the DOM Scripting Task Force, at http://domscripting.webstandards.org/
- The Mozilla Project’s Developer Documents on DOM, at http://developer.mozilla.org/en/docs/DOM (also a good resource for JavaScript documents, at http://developer.mozilla.org/en/docs/JavaScript)
JavaScript Libraries for Ajax Applications
Ajax-enabled applications have been around since 2005, when Jesse James Garrett wrote the essay in which he coined the term Ajax because he “needed something shorter than ‘Asynchronous JavaScript + CSS + DOM + XMLHttpRequest’ to use when discussing this approach with clients.” There has been more than enough time since then for third-party development of JavaScript function libraries to enable developers in their creation of Ajax applications.
Some popular libraries are listed next, although spending some time at any Ajax developer websites will quickly introduce you to many more. Selecting one (or more) to use will decrease your development time because you will not, as previously mentioned, have to reinvent the wheel.
- The Prototype JavaScript Framework simplifies DOM manipulation, and the use of the XMLHTTPRequest object, on the way to creating complex Ajax applications. For more information, visit http://www.prototypejs.org/.
- Dojo is an open-source toolkit that includes basic JavaScript functions as well as a widget creation framework and a mechanism for efficiently packaging and delivering code to the end user. For more information, visit http://dojotoolkit.org/.
- MochiKit is a lightweight library that includes functions for working with the DOM and formatting output for the end user. The MochiKit tagline is a bit crude but honest: “MochiKit makes JavaScript suck less.” The functions and solutions in MochiKit, the documentation available for developers, and the sample projects created with the use of MochiKit make this worthy of review. For more information, visit http://mochikit.com/.
Ajax Developer Websites
Finally, the best way to learn about Ajax development is to try it. Gather some code snippets, figure out how to integrate pieces into your existing applications, and learn from those who have been working with the technologies for some time. Following are some resources that will help get you started in Ajax development:
- Ajaxian is a developer portal providing news, articles, tutorials, and sample code for new and experienced developers. For more information, visit http://ajaxian.com/.
- Ajax Matters contains in-depth articles on Ajax development. For more information, visit http://www.ajaxmatters.com/.
- Ajax Lines is another developer portal with links to news and articles on all things Ajax. For more information, visit http://www.ajaxlines.com/.