| Contents at a Glance | 6 |
---|
| Contents | 8 |
---|
| About the Author | 14 |
---|
| About the Technical Reviewer | 16 |
---|
| Acknowledgments | 18 |
---|
| Introduction | 20 |
---|
| CHAPTER 1 Introduction to Ajax | 24 |
---|
| Pictures Are Worth a Thousand Words | 25 |
| Another Ajax Example | 31 |
| Ajax Architecture Basics | 33 |
| It s About the Data | 34 |
| It s About the Navigation | 35 |
| Comparing Ajax to Other Application Types | 37 |
| Rich-Client Local Installation | 37 |
| Rich-Client Web Services | 38 |
| Plain-Vanilla Web Application | 39 |
| Some Final Thoughts | 40 |
| CHAPTER 2 The Nuts and Bolts of Ajax | 42 |
---|
| Ajax for the Impatient | 42 |
| Understanding REST Theory | 42 |
| Implementing the REST Data | 44 |
| Implementing the Ajax Application | 45 |
| Putting Together Ajax and REST | 46 |
| Understanding the Ramifications of Ajax and REST | 47 |
| XMLHttpRequest Details | 48 |
| Using the Factory Pattern | 50 |
| Defining an XMLHttpRequest Factory | 51 |
| Rewriting the Ajax Application to Use a Factory | 52 |
| Making Asynchronous Requests | 53 |
| Making Practical Use of XMLHttpRequest | 57 |
| Implementing an Asynchronous Calling Mechanism | 57 |
| Calling Domains Other Than the Serving Domain | 68 |
| Some Final Thoughts | 74 |
| CHAPTER 3 Content Chunking Pattern | 76 |
---|
| Intent | 76 |
| Motivation | 76 |
| Applicability | 77 |
| Associated Patterns | 78 |
| Architecture | 78 |
| Implementing Order in a Web Application | 78 |
| Defining the Content Within a Content Chunk | 82 |
| Implementation | 83 |
| Implementing the HTML Framework Page | 83 |
| Injecting Content by Using Dynamic HTML | 85 |
| Binary, URL, and Image Chunking | 92 |
| JavaScript Chunking | 95 |
| Pattern Highlights | 100 |
| CHAPTER 4 Cache Controller Pattern | 102 |
---|
| Intent | 102 |
| Motivation | 102 |
| Applicability | 104 |
| Associated Patterns | 105 |
| Architecture | 105 |
| HTML and HTTP Cache Directives | 105 |
| HTTP Expiration Caching Is a Bad Idea (Generally) | 107 |
| Better Approach: Using HTTP Validation | 107 |
| Some Findings Regarding Server-Side Caching | 109 |
| Defining Static HTTP Validation | 111 |
| Defining Dynamic HTTP Validation | 112 |
| Implementation | 114 |
| Implementing the Passive Cache | 114 |
| Implementing the Server Side of the HTTP Validator | 123 |
| Pattern Highlights | 131 |
| CHAPTER 5 Permutations Pattern | 134 |
---|
| Intent | 134 |
| Motivation | 134 |
| Applicability | 139 |
| Associated Patterns | 139 |
| Architecture | 139 |
| Understanding Why the Resource Is Separated from the Representation | 140 |
| Using Cookies and HTTP Authentication to Authorize Access Only | 142 |
| Using Cookies | 145 |
| An Example Book Application | 146 |
| Implementation | 151 |
| Rewriting URLs | 151 |
| An Example Shopping Cart Application | 158 |
| Pattern Highlights | 173 |
| CHAPTER 6 Decoupled Navigation Pattern | 176 |
---|
| Intent | 176 |
| Motivation | 176 |
| Applicability | 180 |
| Associated Patterns | 182 |
| Architecture | 183 |
| Implementation | 185 |
| Implementing the Action Functionality | 185 |
| Defining and Implementing the Common Data Functionality | 195 |
| Implementing the Presentation Functionality | 210 |
| Using HTML Components | 215 |
| Pattern Highlights | 2
|