9780132216357

Understanding Ajax : Using JavaScript to Create Rich Internet Applications

by
  • ISBN13:

    9780132216357

  • ISBN10:

    0132216353

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2007-01-01
  • Publisher: Prentice Hall
  • Purchase Benefits
  • Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $44.99 Save up to $6.75
  • Buy New
    $38.24
    Add to Cart Free Shipping

    CURRENTLY AVAILABLE, USUALLY SHIPS IN 24-48 HOURS

Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The eBook copy of this book is not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Summary

The intermediate-level guide to AJAX applications - the development technique that is revolutionizing the web!

Author Biography

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.

Table of Contents

Acknowledgments xiii
About the Author xv
Preface xvii
PART I
Chapter 1 What Is AJAX?
3(12)
1.1 Rich Internet Applications
4(1)
1.2 AJAX Defined
5(2)
1.3 Technologies of AJAX
7(2)
1.4 Remote Scripting
9(1)
1.5 Gmail Brings XMLHttpRequest into the Mainstream
9(3)
1.6 New Name: AJAX
12(1)
1.7 Summary
12(3)
Chapter 2 Getting Started
15(26)
2.1 XMLHttpRequest Overview
16(5)
2.1.1 XMLHttpRequest : :Open ()
17(1)
2.1.2 XMLHttpRequest : :Send ()
17(1)
2.1.3 XMLHttpRequest : : setRequestHeader ()
18(1)
2.1.4 XMLHttpRequest : :getResponseHeader () and getAllResponseHeaders ()
19(1)
2.1.5 Other XMLHttpRequest Methods
19(1)
2.1.6 XMLHttpRequest Properties
20(1)
2.1.7 readyState Reference
20(1)
2.2 Cross-Browser XMLHttpRequest
21(2)
2.3 Sending Asynchronous Requests
23(6)
2.4 AJAX Without XMLHttpRequest
29(2)
2.5 Fallback Option 1: Sending a Request Using an IFrame
31(5)
2.5.1 Creating a Hidden IFrame
31(1)
2.5.2 Creating a Form
32(1)
2.5.3 Send Data from the Loaded Content to the Original Document
32(1)
2.5.4 Complete IFrame AJAX Example
33(3)
2.6 Fallback Option 2: Sending a Request Using a Cookie
36(3)
2.7 Summary
39(2)
Chapter 3 Consuming the Sent Data
41(36)
3.1 Document-Centric Approaches
42(12)
3.1.1 Adding New HTML Content to a Page with AJAX
42(3)
3.1.2 Consuming XML Using DOM
45(5)
3.1.3 Consuming XML Using XSLT
50(4)
3.2 Remote Scripting
54(20)
3.2.1 Basic RPC
56(10)
3.2.2 SOAP and XML-RPC
66(1)
3.2.3 Custom XML
66(6)
3.2.4 JavaScript and JSON
72(2)
3.3 How to Decide on a Request Type
74(1)
3.4 Summary
75(2)
Chapter 4 Adding AJAX to Your Web Development Process
77(22)
4.1 Changes to the Development Cycle
78(8)
4.1.1 Enhancement-Driven Changes
79(1)
4.1.2 AJAX in Action: Removing a Popup User Search
80(2)
4.1.3 Changes Caused by Creating an AJAX-Driven Application
82(4)
4.2 Integrating AJAX into a Framework
86(1)
4.3 JavaScript as a Primary Development Language
87(1)
4.4 Problems Created by the New Development Paradigm
88(1)
4.5 Advantages to Using a Library
89(2)
4.6 Reasons to Build Your Own Library
91(1)
4.7 How Open Source Fits into the Mix
91(4)
4.7.1 Evaluating an Open Source Library
92(1)
4.7.2 Open Source Libraries in Relation to Commercial Libraries
93(2)
4.8 Use Case for Building: The Firefox Counter
95(2)
4.9 Use Case for Downloading: An Intranet Web Site
97(1)
4.10 Summary
98(1)
Chapter 5 Getting the Most from AJAX
99(20)
5.1 Goals of AJAX
100(7)
5.1.1 Increasing Interactivity
100(3)
5.1.2 Decreasing the Time Required to Perform Actions
103(2)
5.1.3 Reducing Bandwidth Use
105(1)
5.1.4 Creating Rich Applications
106(1)
5.2 Measuring Improvements
107(8)
5.3 Promises and Problems of Combining AJAX with Other New Technologies
115(2)
5.3.1 Combining AJAX with Flash
115(1)
5.3.2 Scalable Vector Graphics (SVG)
116(1)
5.3.3 XML User Interface Languages
116(1)
5.4 Summary
117(2)
Chapter 6 Usability Guidelines
119(18)
6.1 Defining Usability
120(1)
6.2 Usability Guidelines
121(4)
6.2.1 Keep the User's Expectations in Mind
122(1)
6.2.2 Provide Feedback to Actions
122(1)
6.2.3 Maintain the User's Focus When Adding Content
123(1)
6.2.4 Keep the Ability to Undo Actions
123(1)
6.2.5 Know If You Are Developing an Application or a Web Site
124(1)
6.2.6 Only Use AJAX Where It Has the Greatest Effect
124(1)
6.2.7 Have a Plan for Those Users Without xMLHttpRequest
124(1)
6.3 Common Usability Problems
125(9)
6.3.1 Stealing Focus with Validation Messages
125(4)
6.3.2 Preventing Undo with Autosave
129(1)
6.3.3 Updating Sections of a Page Without the User Realizing It
130(3)
6.3.4 Breaking Bookmarking by Using AJAX to Load Entire Pages
133(1)
6.3.5 Making AJAX Required on a Web Store
134(1)
6.4 Summary
134(3)
Chapter 7 AJAX Debugging Guide
137(30)
7.1 Two Sides to Debugging
138(1)
7.2 Looking at AJAX Communications
139(17)
7.2.1 Building an AJAX Logger
139(4)
7.2.2 Using the Logger
143(1)
7.2.3 Firebug: A Firefox Debugging Extension
144(7)
7.2.4 Fiddler
151(4)
7.2.5 General Debugging Scenarios
155(1)
7.3 JavaScript Debugging Tools
156(4)
7.4 JavaScript Exceptions
160(1)
7.5 Dumping Variables
161(2)
7.6 Summary
163(4)
PART II
Chapter 8 Libraries Used in Part II: Sarissa, Scriptaculous
167(28)
8.1 Overview of the Use Cases
168(1)
8.2 Libraries Used in Part II of This Book
168(1)
8.3 Sarissa
169(12)
8.3.1 Installation
169(1)
8.3.2 Making an AJAX Request
169(2)
8.3.3 Basic XML Features
171(1)
8.3.4 Working with DOM Documents
171(3)
8.3.5 Using XPath to Find Nodes in a Document
174(4)
8.3.6 Transforming XML with XSIT
178(3)
8.3.7 Sarissa Development Tips
181(1)
8.4 Scriptaculous
181(12)
8.4.1 Installation
182(1)
8.4.2 Visual Effects
182(1)
8.4.3 Hide/Show Pairs
182(3)
8.4.4 Drag-and-Drop
185(2)
8.4.5 Sortables
187(2)
8.4.6 Slider Control
189(3)
8.4.7 Scriptaculous Development Tips
192(1)
8.5 Summary
193(2)
Chapter 9 Libraries Used in Part II: HTML_AJAX
195(22)
9.1 HTML_AJAX
196(18)
9.1.1 Installation
197(1)
9.1.2 HTML_AJAX JavaScript API
198(7)
9.1.3 Remote Stub AJAX
205(3)
9.1.4 Using HTMLAJAX_Action
208(2)
9.1.5 JavaScript Behaviors
210(1)
9.1.6 JavaScript Utility Methods
211(2)
9.1.7 PHP Utility Methods
213(1)
9.1.8 HTML_AJAX Development Tips
214(1)
9.2 Summary
214(3)
Chapter 10 Speeding Up Data Display
217(32)
10.1 Overview of the Sun Rise and Set Data Viewer
218(2)
10.2 Building the Non-AJAX Version of the Sun Rise and Set Viewer
220(12)
10.2.1 SunRiseSet Class
222(6)
10.2.2 Graph.php
228(1)
10.2.3 Standard.php
228(4)
10.3 Problems with the Non-AJAX Viewer
232(2)
10.4 Improving Viewing with AJAX
234(13)
10.4.1 Viewer HTML Updated for AJAX
235(4)
10.4.2 Viewer PHP Script Updated for AJAX
239(8)
10.5 Summary
247(2)
Chapter 11 Adding an AJAX Login to a Blog
249(22)
11.1 Why Logins Work Well with AJAX
250(1)
11.2 Building an AJAX Login
250(6)
11.3 Extending the Login Form
256(6)
11.4 Implementing the AJAX Comment Login System Using XML
262(8)
11.5 Summary
270(1)
Chapter 12 Building a Trouble-Ticket System
271(62)
12.1 Trouble-Ticketing System
272(2)
12.2 AJAX Reliance Scale
274(1)
12.3 Creating the Back End
275(7)
12.4 Exporting the Back End
282(6)
12.5 Building the JavaScript Application
288(11)
12.6 Login Component
299(6)
12.7 User-Registration Component
305(3)
12.8 Account-Editing Component
308(2)
12.9 Ticket-Creation Component
310(2)
12.10 Ticket-Editor Component
312(6)
12.11 My-Tickets Component
318(5)
12.12 Assign-Tickets Component
323(5)
12.13 Security Considerations with AJAX Applications
328(1)
12.14 Comparing Our AJAX-Driven Application against a Standard MVC Model
329(1)
12.15 Summary
330(3)
Appendix A JavaScript AJAX Libraries 333(6)
AJAX Toolbox
334(1)
Bajax
334(1)
Dojo Toolkit
334(1)
libXmlRequest
335(1)
MochiKit
335(1)
Rico
335(1)
Simple AJAX Code-Kit (SACK)
336(1)
ThyAPI
336(1)
Qooxdoo
336(1)
XHConn
337(1)
Yahoo! User Interface Library
337(2)
Appendix B AJAX Libraries with Server Ties 339(8)
PHP
340(2)
AjaxAC
340(1)
HTML_AJAX
340(1)
PAJAJ
340(1)
TinyAjax
341(1)
Xajax
341(1)
XOAD
341(1)
Java
342(1)
AjaxTags
342(1)
Direct Web Remoting (DWR)
342(1)
Google Web Toolkit
342(1)
ZK
343(1)
C#/.NET
343(2)
Ajax.NET
343(1)
Anthem.NET
344(1)
Atlas
344(1)
MagicAJAX.NET
344(1)
Multiple Languages
345(2)
CPAINT
345(1)
Rialto
345(1)
SAJAX
346(1)
Appendix C JavaScript DHTML Libraries 347(6)
Accesskey Underlining Library (AUL)
348(1)
Behaviour
348(1)
cssQuery()
348(1)
Dean Edwards IE7
349(1)
DOM-Drag
349(1)
JavaScript Shell
349(1)
Lightbox JS
350(1)
Moo.fx
350(1)
Nifty Corners Cube
350(1)
overLIB
351(1)
Sorttable
351(1)
Tooltip.js
351(1)
WZ_jsgraphics
352(1)
WZ_dragdrop
352(1)
Index 353

Excerpts

= 0) {slash = '\\';} else {slash = '/';}openLoc = figLoc.substring(0, figLoc.lastIndexOf(slash) + 1);while (pPage.substring(0,3) == '../') {openLoc = openLoc.substring(0, openLoc.lastIndexOf(slash, openLoc.length - 2)+ 1);pPage = pPage.substring(3, pPage.length + 1);}popUpWin =window.open('','popWin','resizable=1,scrollbars=1,location=0,toolbar=0,width=525,height=394');figDoc = popUpWin.document;zhtm= ' ' + pPage + ' ';zhtm += ' ';zhtm += ' ';zhtm += ' ';zhtm += '' + pPage.substring(pPage.lastIndexOf('/') + 1, pPage.length) + '';zhtm += ' ';figDoc.write(zhtm);figDoc.close();}// modified 3.1.99 RWE v4.1 --> Preface Preface 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:Ways to perform AJAX communicationsAJAX communications models, both Remote Procedure Call (RPC) and document-centricUsability guidelines and tipsHow to choose an AJAX libraryWays to measure improvements in task completion speedsHow to add AJAX to an existing applicationHow to build rich applicationsHow to debug AJAX applicationsThe Sarissa Extensible Markup Language (XML) AJAX libraryScriptaculous effects and widgetsHTML_AJAX, which is an AJAX l

Rewards Program

Write a Review