AudienceThis book is intended for Web developers who understand how to build Web applications and have a basic understanding of JavaScript. JavaScript knowledge should include the ability to do Document Object Model (DOM) manipulation and the ability to use object-oriented libraries. Basic understanding of PHP is also helpful for understanding many of the examples in the book, but it isn't required because this book focuses on client-side JavaScript programming. Understanding the stateless nature of HTTP and how tools (such as cookies) can be used to work around this stateless nature is also useful. As I wrote this book, I assumed that you had knowledge of Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS). If you are a Web developer who has used JavaScript before, you should be able to use what you've learned from this book to add Asynchronous JavaScript and XML (AJAX) to your sites. If this is the first time you've looked at JavaScript, you will want to find an introductory reference source before delving into AJAX. I recommend the Mozilla developer Web site at http://developer.mozilla.org/en/docs/JavaScript. It contains a comprehensive JavaScript reference and an introduction to the language. What You Will LearnThis book focuses on using AJAX to create a new style of Web applications. It covers the following topics:
The goal of this book is to add AJAX as a tool in your arsenal, not to cover every aspect of JavaScript and Web programming. To do this, we cover AJAX in a number of different ways, starting with basic implementation. We then move on to more theoretical topics, such as usability, and then finish by building actual applications. Organization of the BookThis book is divided into two main parts and three appendixes. The first part, which encompasses Chapters 17, covers the basics of AJAX and how it fits into the rest of the Web development world. It includes introductions to the basic technology (such as XMLHttpRequest), facts about how to get the most out of AJAX, and tips regarding usability. Chapter 7 covers debugging, because bugs are bound to happen in any development environment, and AJAX affects how you implement many current Web-development debugging techniques. The second part, which encompasses Chapters 812, contains three use cases. These use cases show how you can use AJAX to solve usability problems and improve performance on your current Web sites. The final use case also shows what is involved in building a JavaScript-powered application. Finally, the appendixes summarize a large number of open source libraries. These include AJAX libraries and various JavaScript support libraries. I know that everyone requires different features from an AJAX library; these features range from specific server-side language support to DHTML features such as visual effects and drag-and-drop support. However, it's impossible for me to give detailed coverage of all the libraries, so I've chosen to focus only on those that I use on a regular basis. These libraries may not meet your needs, especially if you're using a server-side language other than PHP and you want complete server-side integration. To help with the process of picking a different library, the appendixes give you a starting point for picking a library to use if the ones covered in detail in this book don't meet your needs. Web BrowsersAny book that includes JavaScript code needs to make some assumptions about the Web browsers that will be used. All examples shown in this book have been tested on Internet Explorer 6 and Firefox 1.5. The code should work in newer versions without much trouble, but it may have small problems with other browsers. This is especially true for older browsers such as Internet Explorer 4 or Netscape 4.7; in fact, none of the examples in this book would run on these browsers without a lot of changes. Browsers have advanced over time, and the vast majority of users have upgraded. If you need to support old browsers, do it with non-JavaScript versions of your application; supporting AJAX on ancient technology will make support a nightmare. Why PHP?The main focus of this book is on the client-side JavaScript code, but in many of the examples, server code is also shown to present the complete processes. PHP was chosen as the language for these examples because of its widespread use and my familiarity with it. The concepts shown on the server-side code should be easily transferable to any other language, although each language will have its own implementation details. Summary of ChaptersThe first part of the book builds a basic understanding of AJAX and shows how the technology works. It builds a foundation that will allow you to build complete applications. Specifically, it covers the following:
The second part of this book introduces you to three AJAX libraries and then looks at use cases in which they are used. Specifically, it covers the following:
Several appendixes cover various AJAX and JavaScript libraries that you might find useful while implementing your own AJAX application. Specifically, they cover the following:
Typographical ConventionsTypographic conventions are used throughout this book to convey information. Italic font is used for emphasis and for citations of others' work. Code-based items are shown like this and include variable names, function and class names, and filenames. Where to Get Examples Used in This bookThe example programs used in this book can be found at http://understandingajax.net. |