Understanding AJAX: Using JavaScript to Create Rich Internet Applications

2.43 avg rating
( 7 ratings by Goodreads )
 
9780132216357: Understanding AJAX: Using JavaScript to Create Rich Internet Applications

AJAX: fast mastery for experienced Web developers!

 

Already an experienced Web developer? Apply your skills in today’s fastest-growing area of Web development: AJAX!

 

Building on what you already know, this fast-paced guide will show you exactly how to create rich, usable Internet applications. Joshua Eichorn teaches through sophisticated code examples, including extensive server-side PHP code.

 

You won’t just learn how to code AJAX applications: Eichorn covers the entire development lifecycle, from use cases and design through debugging. He also presents detailed application case studies, including a start-to-finish update of a non-AJAX application that addresses everything from feature improvements to changing usage patterns. Coverage includes:

 

·       How AJAX changes the conventional Web development cycle

·       Problems created by the AJAX paradigm -- and how to avoid them

·       Adding AJAX to existing Web applications: key considerations

·       Using core AJAX technologies, including the XMLHttpRequest object

·       Consuming data returned to an AJAX application using both XSLT and JSON

·       Building more usable AJAX applications: guidelines and downloadable resources

·       Use cases: solving real-world problems in the AJAX environment

·       Libraries and toolkits for simplifying AJAX development, including Sarissa, scriptaculous, and HTML_AJAX

·       A complete guide to AJAX debugging

·       Supporting browsers without XMLHttpRequest by using IFrames or cookies

·       JSON data encoding debugging guide, which covers tools for Firefox and Internet Explorer

·       A list of libraries, which includes PHP, .NET, Java, and other libraries that can be used with any server language

"synopsis" may belong to another edition of this title.

About the Author:

Joshua Eichorn, senior architect for Uversa, has developed custom solutions that have incorporated AJAX concepts since before the term “AJAX” was coined. He has more than six years’ experience with Open Source projects, and created phpDocumentor, the #1 PHP documentation solution. He is currently lead maintainer of the HTML_AJAX PHP PEAR library, and helps to run the Phoenix, Arizona PHP Users Group. His blog, There and Back Again (blog.joshuaeichorn.com) , focuses on AJAX and PHP innovations.

Excerpt. Reprinted by permission. All rights reserved.:

Preface

Preface

Audience

This 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 Learn

This book focuses on using AJAX to create a new style of Web applications. It covers the following topics:

  • Ways to perform AJAX communications

  • AJAX communications models, both Remote Procedure Call (RPC) and document-centric

  • Usability guidelines and tips

  • How to choose an AJAX library

  • Ways to measure improvements in task completion speeds

  • How to add AJAX to an existing application

  • How to build rich applications

  • How to debug AJAX applications

  • The Sarissa Extensible Markup Language (XML) AJAX library

  • Scriptaculous effects and widgets

  • HTML_AJAX, which is an AJAX library with PHP support

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 Book

This 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 Browsers

Any 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 Chapters

The 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:

  • Chapter 1, "What Is AJAX?" provides an overview of AJAX, what it actually means, and where it came from.

  • Chapter 2, "Getting Started," is a guide to basic AJAX implementation covering AJAX communications powered by XMLHttpRequest, IFrames, and cookies.

  • Chapter 3, "Consuming the Sent Data," shows the various ways to use the data that you learned how to transmit between the client and server in Chapter 2. It includes both document-centric approaches (such as processing XML and displaying HTML) and RPC approaches.

  • Chapter 4, "Adding AJAX to Your Web Development Process," covers some of the ways that AJAX will change the development process and the ways in which you can deal with these changes. It also covers how to pick an AJAX library.

  • Chapter 5, "Getting the Most from AJAX," provides a mental framework for thinking about AJAX and deciding when to use it. The chapter also provides some basic tools for measuring the time it takes for a task to be completed.

  • Chapter 6, "Usability Guidelines," provides a set of usability guidelines for building AJAX applications.

  • Chapter 7, "AJAX Debugging Guide," covers the various debugging options, from logging techniques to handling JavaScript exceptions, and a number of useful tools. These include the Firebug Firefox extension and Fiddler, which is a debugging HTTP proxy.

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:

  • Chapter 8, "Libraries Used in Part II: Sarissa, Scriptaculous," provides an overview of the Sarissa and scriptaculous JavaScript libraries.

  • Chapter 9, "Libraries Used in Part II: HTML_AJAX," provides an overview of HTML_AJAX, which is a JavaScript and PHP AJAX library.

  • Chapter 10, "Speeding Up Data Display," builds a small application for browsing large amounts of data and dealing with a graph that is very slow to generate.

  • Chapter 11, "Adding an AJAX Login to a Blog" adds an AJAX login to a sample blog application, showing how an AJAX login could work and how it could be used to load additional information at the time it is needed.

  • Chapter 12, "Building a Trouble-Ticket System," builds a complete JavaScript-powered application. All the control and view logic is managed on the client side, and a set of services for interacting with the database is provided by the server.

Several appendixes cover various AJAX and JavaScript libraries that you might find useful while implementing your own AJAX application. Specifically, they cover the following:

  • Appendix A, "JavaScript AJAX Libraries," covers AJAX libraries that have only a JavaScript component.

  • Appendix B, "AJAX Libraries with Server Ties," details AJAX libraries that have a server-side component and a JavaScript component; the list is organized by server language.

  • Appendix C, "JavaScript DHTML Libraries," gives information about JavaScript libraries that is useful for adding rich, JavaScript elements to your Web applications.

Typographical Conventions

Typographic 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 book

The example programs used in this book can be found at http://understandingajax.net.


© Copyright Pearson Education. All rights reserved.

"About this title" may belong to another edition of this title.

Top Search Results from the AbeBooks Marketplace

1.

Eichorn, Joshua
Published by Prentice Hall
ISBN 10: 0132216353 ISBN 13: 9780132216357
New PAPERBACK Quantity Available: 1
Seller
Your Online Bookstore
(Houston, TX, U.S.A.)
Rating
[?]

Book Description Prentice Hall. PAPERBACK. Book Condition: New. 0132216353 Ships promptly. Bookseller Inventory # HGT2171.1KBGG061617H0247A

More Information About This Seller | Ask Bookseller a Question

Buy New
20.12
Convert Currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, Rates & Speeds

2.

Joshua Eichorn
Published by Prentice Hall
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Quantity Available: > 20
Seller
INDOO
(Avenel, NJ, U.S.A.)
Rating
[?]

Book Description Prentice Hall. Book Condition: New. Brand New. Bookseller Inventory # 0132216353

More Information About This Seller | Ask Bookseller a Question

Buy New
22.29
Convert Currency

Add to Basket

Shipping: 2.69
Within U.S.A.
Destination, Rates & Speeds

3.

Joshua Eichorn
Published by Prentice Hall (2006)
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Paperback Quantity Available: 1
Seller
Irish Booksellers
(Rumford, ME, U.S.A.)
Rating
[?]

Book Description Prentice Hall, 2006. Paperback. Book Condition: New. book. Bookseller Inventory # 0132216353

More Information About This Seller | Ask Bookseller a Question

Buy New
29.80
Convert Currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, Rates & Speeds

4.

Joshua Eichorn
Published by Prentice Hall (2006)
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Paperback Quantity Available: 1
Seller
Ergodebooks
(RICHMOND, TX, U.S.A.)
Rating
[?]

Book Description Prentice Hall, 2006. Paperback. Book Condition: New. 1. Bookseller Inventory # DADAX0132216353

More Information About This Seller | Ask Bookseller a Question

Buy New
32.98
Convert Currency

Add to Basket

Shipping: 3.06
Within U.S.A.
Destination, Rates & Speeds

5.

Joshua Eichorn
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Quantity Available: 1
Seller
Castle Rock
(Pittsford, NY, U.S.A.)
Rating
[?]

Book Description Book Condition: Brand New. Book Condition: Brand New. Bookseller Inventory # 97801322163571.0

More Information About This Seller | Ask Bookseller a Question

Buy New
38.69
Convert Currency

Add to Basket

Shipping: 3.06
Within U.S.A.
Destination, Rates & Speeds

6.

Joshua Eichorn
Published by Prentice Hall (2006)
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Softcover Quantity Available: > 20
Seller
Palexbooks
(Sanford, NC, U.S.A.)
Rating
[?]

Book Description Prentice Hall, 2006. Book Condition: New. Brand new! Please provide a physical shipping address. Bookseller Inventory # 9780132216357

More Information About This Seller | Ask Bookseller a Question

Buy New
41.80
Convert Currency

Add to Basket

Shipping: 2.30
Within U.S.A.
Destination, Rates & Speeds

7.

Eichorn, Joshua
Published by Prentice Hall
ISBN 10: 0132216353 ISBN 13: 9780132216357
New PAPERBACK Quantity Available: 1
Seller
Cloud 9 Books
(Wellington, FL, U.S.A.)
Rating
[?]

Book Description Prentice Hall. PAPERBACK. Book Condition: New. 0132216353 New Condition. Bookseller Inventory # NEW6.0050429

More Information About This Seller | Ask Bookseller a Question

Buy New
47.43
Convert Currency

Add to Basket

Shipping: 3.83
Within U.S.A.
Destination, Rates & Speeds

8.

Joshua Eichorn
Published by Prentice Hall PTR (2006)
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Paperback Quantity Available: 1
Seller
Revaluation Books
(Exeter, United Kingdom)
Rating
[?]

Book Description Prentice Hall PTR, 2006. Paperback. Book Condition: Brand New. 1st edition. 362 pages. 9.00x7.00x0.75 inches. In Stock. Bookseller Inventory # zk0132216353

More Information About This Seller | Ask Bookseller a Question

Buy New
48.18
Convert Currency

Add to Basket

Shipping: 6
From United Kingdom to U.S.A.
Destination, Rates & Speeds

9.

Joshua Eichorn
ISBN 10: 0132216353 ISBN 13: 9780132216357
New Paperback Quantity Available: 1
Seller
AMAZINGBOOKDEALS
(IRVING, TX, U.S.A.)
Rating
[?]

Book Description Paperback. Book Condition: BRAND NEW. BRAND NEW. Fast Shipping. Prompt Customer Service. Satisfaction guaranteed. Bookseller Inventory # 0132216353BNA

More Information About This Seller | Ask Bookseller a Question

Buy New
62.68
Convert Currency

Add to Basket

Shipping: 3.06
Within U.S.A.
Destination, Rates & Speeds