So you are going to read a book about Ajax and wonder if does make sense to read this one or another one like Ajax in Practice from Manning, or Head Rush Ajax, Professional Ajax, Pro Ajax and Java Frameworks to note only a few. If you decide to have a look at this one, take care: the material is really deep. Definitely it is not an "instant" style like "for dummies" or "in 10 minutes", so if you think you will be an Ajax expert after reading 10 pages just have a look at another one, this one is really for someone who understand that in order to be an expert you have to sweat. The book starts out talking about key concepts like why Ajax, what is Ajax, what are the alternatives to Ajax, what is CSS, what is DOM, what does it mean to load the data in a browser using an asynchronous way, MVC concepts applied to a web server and some common patterns like Observer, Command or Façade. Ok now you might already have a clear vision of Ajax basis and the world in which Ajax lives, so let's see the core techniques, and this is what the authors present starting with the second part, just core techniques. A few key points: if we look at a page as an application with all the MVC in a page than what is the role of a server, how to code the server side, do we need to use frameworks for the server side and how we can exchange data. The book is not really a practical book with pre-build examples ready to be applied, is much more oriented to the theory of Ajax and assumes a certain level of competency, so the examples are almost all only partial or abstracted. Starting on the 3rd part we finally see some common examples like keeping the user informed, indicating the freshness of data or designing a notification system. But this part is not intended to offer only examples, but to be a complete support to someone who already knows the basic and expects a professional view of Ajax. So now it is supposed to have all the info to create something from zero to the end. Well ...almost to the end because only the end of this part we will see how to add security and how to design for performance. Now you have all the info about Ajax and want to start your own coding. The book is here to help you: just read the last part, a kind of "by example" full of examples. Overall, the book is written in an academic manner: intro, theory, examples that prove the theory , advanced stuff, examples for the advanced stuff, practical examples. Nothing new in terms of composition. My advice: if you like this traditional style, you want a solid background and you have the time and ability to read 600 pages , just do it , you will not regret any single page. Otherwise if you are under pressure, my advice is to read Ajax in Practice, by Manning too. preface 21 acknowledgments 23 about this book 26 Who should read this book? 27 Roadmap 27 Code conventions 30 Code downloads 30 Author Online 31 About the title 31 About the cover illustration 32 Rethinking the web application 33 A new design for the Web 35 1.1 Why Ajax rich clients? 37 1.1.1 Comparing the user experiences 37 1.1.2 Network latency 41 1.1.3 Asynchronous interactions 44 1.1.4 Sovereign and transient usage patterns 47 1.1.5 Unlearning the Web 48 1.2 The four defining principles of Ajax 49 1.2.1 The browser hosts an application, not content 49 1.2.2 The server delivers data, not content 51 1.2.3 User interaction with the application can be fluid and continuous 53 1.2.4 This is real coding and requires discipline 55 1.3 Ajax rich clients in the real world 56 1.3.1 Surveying the field 56 1.3.2 Google Maps 57 1.4 Alternatives to Ajax 60 1.4.1 Macromedia Flash-based solutions 60 1.4.2 Java Web Start and related technologies 60 1.5 Summary 61 1.6 Resources 62 First steps with Ajax 63 2.1 The key elements of Ajax 64 2.2 Orchestrating the user experience with JavaScript 66 2.3 Defining look and feel using CSS 68 2.3.1 CSS selectors 69 2.3.2 CSS style properties 71 2.3.3 A simple CSS example 72 2.4 Organizing the view using the DOM 77 2.4.1 Working with the DOM using JavaScript 79 2.4.2 Finding a DOM node 81 2.4.3 Creating a DOM node 82 2.4.4 Adding styles to your document 83 2.4.5 A shortcut: Using the innerHTML property 85 2.5 Loading data asynchronously using XML technologies 85 2.5.1 IFrames 86 2.5.2 XmlDocument and XMLHttpRequest objects 88 2.5.3 Sending a request to the server 90 2.5.4 Using callback functions to monitor the request 93 2.5.5 The full lifecycle 94 2.6 What sets Ajax apart 97 2.7 Summary 99 2.8 Resources 100 Introducing order to Ajax 101 3.1 Order out of chaos 103 3.1.1 Patterns: creating a common vocabulary 103 3.1.2 Refactoring and Ajax 104 3.1.3 Keeping a sense of proportion 105 3.1.4 Refactoring in action 105 3.2 Some small refactoring case studies 109 3.2.1 Cross-browser inconsistencies: Façade and Adapter patterns 109 3.2.2 Managing event handlers: Observer pattern 112 3.2.3 Reusing user action handlers: Command pattern 115 3.2.4 Keeping only one reference to a resource: Singleton pattern 119 3.3 Model-View-Controller 123 3.4 Web server MVC 125 3.4.1 The Ajax web server tier without patterns 125 3.4.2 Refactoring the domain model 128 3.4.3 Separating content from presentation 132 3.5 Third-party libraries and frameworks 135 3.5.1 Cross-browser libraries 136 3.5.2 Widgets and widget suites 140 3.5.3 Application frameworks 143 3.6 Summary 146 3.7 Resources 147 Core techniques 149 The page as an application 151 4.1 A different kind of MVC 152 4.1.1 Repeating the pattern at different scales 152 4.1.2 Applying MVC in the browser 154 4.2 The View in an Ajax application 156 4.2.1 Keeping the logic out of the View 156 4.2.2 Keeping the View out of the logic 162 4.3 The Controller in an Ajax application 166 4.3.1 Classic JavaScript event handlers 166 4.3.2 The W3C event model 169 4.3.3 Implementing a flexible event model in JavaScript 170 4.4 Models in an Ajax application 175 4.4.1 Using JavaScript to model the business domain 176 4.4.2 Interacting with the server 177 4.5 Generating the View from the Model 179 4.5.1 Reflecting on a JavaScript object 179 4.5.2 Dealing with arrays and objects 183 4.5.3 Adding a Controller 186 4.6 Summary 189 4.7 Resources 190 The role of the server 191 5.1 Working with the server side 192 5.2 Coding the server side 193 5.2.1 Popular implementation languages 193 5.2.2 N-tier architectures 194 5.2.3 Maintaining client-side and server-side domain models 195 5.3 The big picture: common server-side designs 196 5.3.1 Naive web server coding without a framework 196 5.3.2 Working with Model2 workflow frameworks 198 5.3.3 Working with component-based frameworks 199 5.3.4 Working with service-oriented architectures 202 5.4 The details: exchanging data 206 5.4.1 Client-only interactions 207 5.4.2 Introducing the planet browser example 207 5.4.3 Thinking like a web page: content-centric interactions 210 5.4.4 Thinking like a plug-in: script-centric interactions 214 5.4.5 Thinking like an application: data-centric interactions 220 5.5 Writing to the server 225 5.5.1 Using HTML forms 225 5.5.2 Using the XMLHttpRequest object 227 5.5.3 Managing user updates effectively 229 5.6 Summary 238 5.7 Resources 239 Professional Ajax 241 The user experience 243 6.1 Getting it right: building a quality application 244 6.1.1 Responsiveness 245 6.1.2 Robustness 245 6.1.3 Consistency 246 6.1.4 Simplicity 247 6.1.5 Making it work 247 6.2 Keeping the user informed 248 6.2.1 Handling responses to our own requests 248 6.2.2 Handling updates from other users 250 6.3 Designing a notification system for Ajax 254 6.3.1 Modeling notifications 255 6.3.2 Defining user interface requirements 257 6.4 Implementing a notification framework 258 6.4.1 Rendering status bar icons 258 6.4.2 Rendering detailed notifications 261 6.4.3 Putting the pieces together 262 6.5 Using the framework with network requests 269 6.6 Indicating freshness of data 273 6.6.1 Defining a simple highlighting style 273 6.6.2 Highlighting with the Scriptaculous Effects library 275 6.7 Summary 276 6.8 Resources 277 Security and Ajax 278 7.1 JavaScript and browser security 279 7.1.1 Introducing the “server of origin” policy 280 7.1.2 Considerations for Ajax 280 7.1.3 Problems with subdomains 281 7.1.4 Cross-browser security 282 7.2 Communicating with remote services 283 7.2.1 Proxying remote services 284 7.2.2 Working with web services 285 7.3 Protecting confidential data 295 7.3.1 The man in the middle 295 7.3.2 Using secure HTTP 296 7.3.3 Encrypting data over plain HTTP using JavaScript 298 7.4 Policing access to Ajax data streams 300 7.4.1 Designing a secure web tier 300 7.4.2 Restricting access to web data 304 7.5 Summary 309 7.6 Resources 310 Performance 311 8.1 What is performance? 312 8.2 JavaScript execution speed 313 8.2.1 Timing your application the hard way 314 8.2.2 Using the Venkman profiler 320 8.2.3 Optimizing execution speed for Ajax 321 8.3 JavaScript memory footprint 334 8.3.1 Avoiding memory leaks 334 8.3.2 Special considerations for Ajax 338 8.4 Designing for performance 343 8.4.1 Measuring memory footprint 344 8.4.2 A simple example 348 8.4.3 Results: how to reduce memory footprint 150-fold 353 8.5 Summary 355 8.6 Resources 356 Ajax by example 357 Dynamic double combo 359 9.1 A double-combo script 360 9.1.1 Limitations of a client-side solution 360 9.1.2 Limitations of a server-side solution 361 9.1.3 Ajax-based solution 362 9.2 The client-side architecture 363 9.2.1 Designing the form 363 9.2.2 Designing the client/server interactions 365 9.3 Implementing the server: VB .NET 366 9.3.1 Defining the XML response format 367 9.3.2 Writing the server-side code 368 9.4 Presenting the results 371 9.4.1 Navigating the XML document 371 9.4.2 Applying Cascading Style Sheets 374 9.5 Advanced issues 375 9.5.1 Allowing multiple-select queries 375 9.5.2 Moving from a double combo to a triple combo 377 9.6 Refactoring 377 9.6.1 New and improved net.ContentLoader 378 9.6.2 Creating a double-combo component 384 9.7 Summary 391 Type-ahead suggest 393 10.1 Examining type-ahead applications 394 10.1.1 Common type-ahead suggest features 394 10.1.2 Google Suggest 396 10.1.3 The Ajax in Action type-ahead 397 10.2 The server-side framework: C# 398 10.2.1 The server and the database 398 10.2.2 Testing the server-side code 400 10.3 The client-side framework 401 10.3.1 The HTML 401 10.3.2 The JavaScript 402 10.3.3 Accessing the server 412 10.4 Adding functionality: multiple elements with different queries 424 10.5 Refactoring 424 10.5.1 Day 1: developing the TextSuggest component game plan 426 10.5.2 Day 2: TextSuggest creation-clean and configurable 429 10.5.3 Day 3: Ajax enabled 433 10.5.4 Day 4: handling events 438 10.5.5 Day 5: the suggestions pop-up UI 445 10.5.6 Refactor debriefing 453 10.6 Summary 454 The enhanced Ajax web portal 455 11.1 The evolving portal 456 11.1.1 The classic portal 456 11.1.2 The rich user interface portal 458 11.2 The Ajax portal architecture using Java 459 11.3 The Ajax login 461 11.3.1 The user table 461 11.3.2 The server-side login code: Java 462 11.3.3 The client-side login framework 465 11.4 Implementing DHTML windows 471 11.4.1 The portal windows database 471 11.4.2 The portal window’s server-side code 473 11.4.3 Adding the JS external library 477 11.5 Adding Ajax autosave functionality 480 11.5.1 Adapting the library 480 11.5.2 Autosaving the information to the database 482 11.6 Refactoring 485 11.6.1 Defining the constructor 487 11.6.2 Adapting the AjaxWindows.js library 488 11.6.3 Specifying the portal commands 490 11.6.4 Performing the Ajax processing 494 11.6.5 Refactoring debrief 496 11.7 Summary 496 Live search using XSLT 498 12.1 Understanding the search techniques 499 12.1.1 Looking at the classic search 499 12.1.2 The flaws of the frame and pop-up methods 501 12.1.3 Examining a live search with Ajax and XSLT 502 12.1.4 Sending the results back to the client 504 12.2 The client-side code 505 12.2.1 Setting up the client 505 12.2.2 Initiating the process 506 12.3 The server-side code: PHP 508 12.3.1 Building the XML document 508 12.3.2 Building the XSLT document 511 12.4 Combining the XSLT and XML documents 513 12.4.1 Working with Microsoft Internet Explorer 515 12.4.2 Working with Mozilla 516 12.5 Completing the search 517 12.5.1 Applying a Cascading Style Sheet 517 12.5.2 Improving the search 519 12.5.3 Deciding to use XSLT 521 12.5.4 Overcoming the Ajax bookmark pitfall 522 12.6 Refactoring 523 12.6.1 An XSLTHelper 524 12.6.2 A live search component 528 12.6.3 Refactoring debriefing 533 12.7 Summary 533 Building stand-alone applications with Ajax 535 13.1 Reading information from the outside world 536 13.1.1 Discovering XML feeds 537 13.1.2 Examining the RSS structure 538 13.2 Creating the rich user interface 541 13.2.1 The process 542 13.2.2 The table-less HTML framework 543 13.2.3 Compliant CSS formatting 545 13.3 Loading the RSS feeds 550 13.3.1 Global scope 550 13.3.2 Ajax preloading functionality 552 13.4 Adding a rich transition effect 556 13.4.1 Cross-browser opacity rules 556 13.4.2 Implementing the fading transition 557 13.4.3 Integrating JavaScript timers 559 13.5 Additional functionality 560 13.5.1 Inserting additional feeds 561 13.5.2 Integrating the skipping and pausing functionality 563 13.6 Avoiding the project’s restrictions 566 13.6.1 Overcoming Mozilla’s security restriction 566 13.6.2 Changing the application scope 569 13.7 Refactoring 569 13.7.1 RSS reader Model 569 13.7.2 RSS reader view 573 13.7.3 RSS reader Controller 577 13.7.4 Refactoring debrief 590 13.8 Summary 591 The Ajax craftsperson’s toolkit 593 A.1 Working smarter with the right toolset 594 A.1.1 Acquiring tools that fit 594 A.1.2 Building your own tools 595 A.1.3 Maintaining your toolkit 596 A.2 Editors and IDEs 597 A.2.1 What to look for in a code editor 597 A.2.2 Current offerings 599 A.3 Debuggers 603 A.3.1 Why we use a debugger 604 A.3.2 JavaScript debuggers 604 A.3.3 HTTP debuggers 609 A.3.4 Building your own cross-browser output console 611 A.4 DOM inspectors 614 A.4.1 Using the Mozilla DOM Inspector 615 A.4.2 DOM inspectors for Internet Explorer 616 A.4.3 The Safari DOM Inspector for Mac OS X 617 A.5 Installing Firefox extensions 617 A.6 Resources 620 JavaScript for object-oriented programmers 621 B.1 JavaScript is not Java 622 B.2 Objects in JavaScript 624 B.2.1 Building ad hoc objects 624 B.2.2 Constructor functions, classes, and prototypes 629 B.2.3 Extending built-in classes 631 B.2.4 Inheritance of prototypes 632 B.2.5 Reflecting on JavaScript objects 633 B.2.6 Interfaces and duck typing 635 B.3 Methods and functions 638 B.3.1 Functions as first-class citizens 638 B.3.2 Attaching functions to objects 639 B.3.3 Borrowing functions from other objects 640 B.3.4 Ajax event handling and function contexts 641 B.3.5 Closures in JavaScript 646 B.4 Conclusions 649 B.5 Resources 649 Ajax frameworks and libraries 651 Accesskey Underlining Library 652 ActiveWidgets 652 Ajax JavaServer Faces Framework 652 Ajax JSP Tag Library 653 Ajax.NET 653 AjaxAC 653 AjaxAspects 654 AjaxCaller 654 AjaxFaces 654 BackBase 654 Behaviour 655 Bindows 655 BlueShoes 655 CakePHP 655 CL-Ajax 656 ComfortASP.NET 656 Coolest DHTML Calendar 656 CPAINT (Cross-Platform Asynchronous Interface Toolkit) 656 Dojo 657 DWR (Direct Web Remoting) 657 Echo 2 657 f(m) 657 FCKEditor 658 Flash JavaScript Integration Kit 658 Google AjaxSLT 658 Guise 658 HTMLHttpRequest 658 Interactive Website Framework 659 Jackbe 659 JPSpan 659 jsolait 659 JSON 659 JSRS (JavaScript Remote Scripting) 660 LibXMLHttpRequest 660 Mochikit 660 netWindows 660 Oddpost 660 OpenRico 661 Pragmatic Objects 661 Prototype 661 Qooxdoo 661 RSLite 662 Ruby on Rails 662 Sack 662 SAJAX 662 Sarissa 663 Scriptaculous 663 SWATO... 663 Tibet 663 TinyMCE 664 TrimPath Templates 664 Walter Zorn’s DHTML Libraries 664 WebORB for .NET 664 WebORB for Java 664 x 665 XAJAX 665 x-Desktop 665 XHConn 665 index 667 Symbols 667 Numerics 667 A 667 B 668 C 669 D 670 E 671 F 672 G 673 H 673 I 673 J 674 K 674 L 674 M 675 N 675 O 676 P 676 Q 677 R 678 S 679 T 680 U 681 V 681 W 681 X 682 Y 682 Z 682 important.pdf 1 Local Disk -1 articlopedia.gigcities.com 1 1.pdf 1 Local Disk -1 All the helpful information you will need is here! 1 1.pdf 1 Local Disk -1 All the helpful information you will need is here! 1 preface......Page 21 acknowledgments......Page 23 about this book......Page 26 Roadmap......Page 27 Code downloads......Page 30 About the title......Page 31 About the cover illustration......Page 32 Rethinking the web application......Page 33 A new design for the Web......Page 35 1.1.1 Comparing the user experiences......Page 37 1.1.2 Network latency......Page 41 1.1.3 Asynchronous interactions......Page 44 1.1.4 Sovereign and transient usage patterns......Page 47 1.1.5 Unlearning the Web......Page 48 1.2.1 The browser hosts an application, not content......Page 49 1.2.2 The server delivers data, not content......Page 51 1.2.3 User interaction with the application can be fluid and continuous......Page 53 1.2.4 This is real coding and requires discipline......Page 55 1.3.1 Surveying the field......Page 56 1.3.2 Google Maps......Page 57 1.4.2 Java Web Start and related technologies......Page 60 1.5 Summary......Page 61 1.6 Resources......Page 62 First steps with Ajax......Page 63 2.1 The key elements of Ajax......Page 64 2.2 Orchestrating the user experience with JavaScript......Page 66 2.3 Defining look and feel using CSS......Page 68 2.3.1 CSS selectors......Page 69 2.3.2 CSS style properties......Page 71 2.3.3 A simple CSS example......Page 72 2.4 Organizing the view using the DOM......Page 77 2.4.1 Working with the DOM using JavaScript......Page 79 2.4.2 Finding a DOM node......Page 81 2.4.3 Creating a DOM node......Page 82 2.4.4 Adding styles to your document......Page 83 2.5 Loading data asynchronously using XML technologies......Page 85 2.5.1 IFrames......Page 86 2.5.2 XmlDocument and XMLHttpRequest objects......Page 88 2.5.3 Sending a request to the server......Page 90 2.5.4 Using callback functions to monitor the request......Page 93 2.5.5 The full lifecycle......Page 94 2.6 What sets Ajax apart......Page 97 2.7 Summary......Page 99 2.8 Resources......Page 100 Introducing order to Ajax......Page 101 3.1.1 Patterns: creating a common vocabulary......Page 103 3.1.2 Refactoring and Ajax......Page 104 3.1.4 Refactoring in action......Page 105 3.2.1 Cross-browser inconsistencies: Façade and Adapter patterns......Page 109 3.2.2 Managing event handlers: Observer pattern......Page 112 3.2.3 Reusing user action handlers: Command pattern......Page 115 3.2.4 Keeping only one reference to a resource: Singleton pattern......Page 119 3.3 Model-View-Controller......Page 123 3.4.1 The Ajax web server tier without patterns......Page 125 3.4.2 Refactoring the domain model......Page 128 3.4.3 Separating content from presentation......Page 132 3.5 Third-party libraries and frameworks......Page 135 3.5.1 Cross-browser libraries......Page 136 3.5.2 Widgets and widget suites......Page 140 3.5.3 Application frameworks......Page 143 3.6 Summary......Page 146 3.7 Resources......Page 147 Core techniques......Page 149 The page as an application......Page 151 4.1.1 Repeating the pattern at different scales......Page 152 4.1.2 Applying MVC in the browser......Page 154 4.2.1 Keeping the logic out of the View......Page 156 4.2.2 Keeping the View out of the logic......Page 162 4.3.1 Classic JavaScript event handlers......Page 166 4.3.2 The W3C event model......Page 169 4.3.3 Implementing a flexible event model in JavaScript......Page 170 4.4 Models in an Ajax application......Page 175 4.4.1 Using JavaScript to model the business domain......Page 176 4.4.2 Interacting with the server......Page 177 4.5.1 Reflecting on a JavaScript object......Page 179 4.5.2 Dealing with arrays and objects......Page 183 4.5.3 Adding a Controller......Page 186 4.6 Summary......Page 189 4.7 Resources......Page 190 The role of the server......Page 191 5.1 Working with the server side......Page 192 5.2.1 Popular implementation languages......Page 193 5.2.2 N-tier architectures......Page 194 5.2.3 Maintaining client-side and server-side domain models......Page 195 5.3.1 Naive web server coding without a framework......Page 196 5.3.2 Working with Model2 workflow frameworks......Page 198 5.3.3 Working with component-based frameworks......Page 199 5.3.4 Working with service-oriented architectures......Page 202 5.4 The details: exchanging data......Page 206 5.4.2 Introducing the planet browser example......Page 207 5.4.3 Thinking like a web page: content-centric interactions......Page 210 5.4.4 Thinking like a plug-in: script-centric interactions......Page 214 5.4.5 Thinking like an application: data-centric interactions......Page 220 5.5.1 Using HTML forms......Page 225 5.5.2 Using the XMLHttpRequest object......Page 227 5.5.3 Managing user updates effectively......Page 229 5.6 Summary......Page 238 5.7 Resources......Page 239 Professional Ajax......Page 241 The user experience......Page 243 6.1 Getting it right: building a quality application......Page 244 6.1.2 Robustness......Page 245 6.1.3 Consistency......Page 246 6.1.5 Making it work......Page 247 6.2.1 Handling responses to our own requests......Page 248 6.2.2 Handling updates from other users......Page 250 6.3 Designing a notification system for Ajax......Page 254 6.3.1 Modeling notifications......Page 255 6.3.2 Defining user interface requirements......Page 257 6.4.1 Rendering status bar icons......Page 258 6.4.2 Rendering detailed notifications......Page 261 6.4.3 Putting the pieces together......Page 262 6.5 Using the framework with network requests......Page 269 6.6.1 Defining a simple highlighting style......Page 273 6.6.2 Highlighting with the Scriptaculous Effects library......Page 275 6.7 Summary......Page 276 6.8 Resources......Page 277 Security and Ajax......Page 278 7.1 JavaScript and browser security......Page 279 7.1.2 Considerations for Ajax......Page 280 7.1.3 Problems with subdomains......Page 281 7.1.4 Cross-browser security......Page 282 7.2 Communicating with remote services......Page 283 7.2.1 Proxying remote services......Page 284 7.2.2 Working with web services......Page 285 7.3.1 The man in the middle......Page 295 7.3.2 Using secure HTTP......Page 296 7.3.3 Encrypting data over plain HTTP using JavaScript......Page 298 7.4.1 Designing a secure web tier......Page 300 7.4.2 Restricting access to web data......Page 304 7.5 Summary......Page 309 7.6 Resources......Page 310 Performance......Page 311 8.1 What is performance?......Page 312 8.2 JavaScript execution speed......Page 313 8.2.1 Timing your application the hard way......Page 314 8.2.2 Using the Venkman profiler......Page 320 8.2.3 Optimizing execution speed for Ajax......Page 321 8.3.1 Avoiding memory leaks......Page 334 8.3.2 Special considerations for Ajax......Page 338 8.4 Designing for performance......Page 343 8.4.1 Measuring memory footprint......Page 344 8.4.2 A simple example......Page 348 8.4.3 Results: how to reduce memory footprint 150-fold......Page 353 8.5 Summary......Page 355 8.6 Resources......Page 356 Ajax by example......Page 357 Dynamic double combo......Page 359 9.1.1 Limitations of a client-side solution......Page 360 9.1.2 Limitations of a server-side solution......Page 361 9.1.3 Ajax-based solution......Page 362 9.2.1 Designing the form......Page 363 9.2.2 Designing the client/server interactions......Page 365 9.3 Implementing the server: VB .NET......Page 366 9.3.1 Defining the XML response format......Page 367 9.3.2 Writing the server-side code......Page 368 9.4.1 Navigating the XML document......Page 371 9.4.2 Applying Cascading Style Sheets......Page 374 9.5.1 Allowing multiple-select queries......Page 375 9.6 Refactoring......Page 377 9.6.1 New and improved net.ContentLoader......Page 378 9.6.2 Creating a double-combo component......Page 384 9.7 Summary......Page 391 Type-ahead suggest......Page 393 10.1.1 Common type-ahead suggest features......Page 394 10.1.2 Google Suggest......Page 396 10.1.3 The Ajax in Action type-ahead......Page 397 10.2.1 The server and the database......Page 398 10.2.2 Testing the server-side code......Page 400 10.3.1 The HTML......Page 401 10.3.2 The JavaScript......Page 402 10.3.3 Accessing the server......Page 412 10.5 Refactoring......Page 424 10.5.1 Day 1: developing the TextSuggest component game plan......Page 426 10.5.2 Day 2: TextSuggest creation-clean and configurable......Page 429 10.5.3 Day 3: Ajax enabled......Page 433 10.5.4 Day 4: handling events......Page 438 10.5.5 Day 5: the suggestions pop-up UI......Page 445 10.5.6 Refactor debriefing......Page 453 10.6 Summary......Page 454 The enhanced Ajax web portal......Page 455 11.1.1 The classic portal......Page 456 11.1.2 The rich user interface portal......Page 458 11.2 The Ajax portal architecture using Java......Page 459 11.3.1 The user table......Page 461 11.3.2 The server-side login code: Java......Page 462 11.3.3 The client-side login framework......Page 465 11.4.1 The portal windows database......Page 471 11.4.2 The portal window’s server-side code......Page 473 11.4.3 Adding the JS external library......Page 477 11.5.1 Adapting the library......Page 480 11.5.2 Autosaving the information to the database......Page 482 11.6 Refactoring......Page 485 11.6.1 Defining the constructor......Page 487 11.6.2 Adapting the AjaxWindows.js library......Page 488 11.6.3 Specifying the portal commands......Page 490 11.6.4 Performing the Ajax processing......Page 494 11.7 Summary......Page 496 Live search using XSLT......Page 498 12.1.1 Looking at the classic search......Page 499 12.1.2 The flaws of the frame and pop-up methods......Page 501 12.1.3 Examining a live search with Ajax and XSLT......Page 502 12.1.4 Sending the results back to the client......Page 504 12.2.1 Setting up the client......Page 505 12.2.2 Initiating the process......Page 506 12.3.1 Building the XML document......Page 508 12.3.2 Building the XSLT document......Page 511 12.4 Combining the XSLT and XML documents......Page 513 12.4.1 Working with Microsoft Internet Explorer......Page 515 12.4.2 Working with Mozilla......Page 516 12.5.1 Applying a Cascading Style Sheet......Page 517 12.5.2 Improving the search......Page 519 12.5.3 Deciding to use XSLT......Page 521 12.5.4 Overcoming the Ajax bookmark pitfall......Page 522 12.6 Refactoring......Page 523 12.6.1 An XSLTHelper......Page 524 12.6.2 A live search component......Page 528 12.7 Summary......Page 533 Building stand-alone applications with Ajax......Page 535 13.1 Reading information from the outside world......Page 536 13.1.1 Discovering XML feeds......Page 537 13.1.2 Examining the RSS structure......Page 538 13.2 Creating the rich user interface......Page 541 13.2.1 The process......Page 542 13.2.2 The table-less HTML framework......Page 543 13.2.3 Compliant CSS formatting......Page 545 13.3.1 Global scope......Page 550 13.3.2 Ajax preloading functionality......Page 552 13.4.1 Cross-browser opacity rules......Page 556 13.4.2 Implementing the fading transition......Page 557 13.4.3 Integrating JavaScript timers......Page 559 13.5 Additional functionality......Page 560 13.5.1 Inserting additional feeds......Page 561 13.5.2 Integrating the skipping and pausing functionality......Page 563 13.6.1 Overcoming Mozilla’s security restriction......Page 566 13.7.1 RSS reader Model......Page 569 13.7.2 RSS reader view......Page 573 13.7.3 RSS reader Controller......Page 577 13.7.4 Refactoring debrief......Page 590 13.8 Summary......Page 591 The Ajax craftsperson’s toolkit......Page 593 A.1.1 Acquiring tools that fit......Page 594 A.1.2 Building your own tools......Page 595 A.1.3 Maintaining your toolkit......Page 596 A.2.1 What to look for in a code editor......Page 597 A.2.2 Current offerings......Page 599 A.3 Debuggers......Page 603 A.3.2 JavaScript debuggers......Page 604 A.3.3 HTTP debuggers......Page 609 A.3.4 Building your own cross-browser output console......Page 611 A.4 DOM inspectors......Page 614 A.4.1 Using the Mozilla DOM Inspector......Page 615 A.4.2 DOM inspectors for Internet Explorer......Page 616 A.5 Installing Firefox extensions......Page 617 A.6 Resources......Page 620 JavaScript for object-oriented programmers......Page 621 B.1 JavaScript is not Java......Page 622 B.2.1 Building ad hoc objects......Page 624 B.2.2 Constructor functions, classes, and prototypes......Page 629 B.2.3 Extending built-in classes......Page 631 B.2.4 Inheritance of prototypes......Page 632 B.2.5 Reflecting on JavaScript objects......Page 633 B.2.6 Interfaces and duck typing......Page 635 B.3.1 Functions as first-class citizens......Page 638 B.3.2 Attaching functions to objects......Page 639 B.3.3 Borrowing functions from other objects......Page 640 B.3.4 Ajax event handling and function contexts......Page 641 B.3.5 Closures in JavaScript......Page 646 B.5 Resources......Page 649 Ajax frameworks and libraries......Page 651 Ajax JavaServer Faces Framework......Page 652 AjaxAC......Page 653 BackBase......Page 654 CakePHP......Page 655 CPAINT (Cross-Platform Asynchronous Interface Toolkit)......Page 656 f(m)......Page 657 HTMLHttpRequest......Page 658 JSON......Page 659 Oddpost......Page 660 Qooxdoo......Page 661 SAJAX......Page 662 Tibet......Page 663 WebORB for Java......Page 664 XHConn......Page 665 A......Page 667 B......Page 668 C......Page 669 D......Page 670 E......Page 671 F......Page 672 I......Page 673 L......Page 674 N......Page 675 P......Page 676 Q......Page 677 R......Page 678 S......Page 679 T......Page 680 W......Page 681 Z......Page 682 Local Disk......Page 0 All the helpful information you will need is here!......Page 1 Val's Blog "A tremendously useful field guide specifically written for developers down in the trenches...waiting for the killer solution..." Web users are getting tired of the traditional web experience. They get frustrated losing their scroll position; they get annoyed waiting for refresh; they struggle to reorient themselves on every new page. And the list goes on. With asynchronous JavaScript and XML, known as "Ajax," you can give them a better experience. Once users have experienced an Ajax interface, they hate to go back. Ajax is new way of thinking that can result in a flowing and intuitive interaction with the user. Ajax in Action helps you implement that thinking--it explains how to distribute the application between the client and the server ( use a "nested MVC" design) while retaining the integrity of the system. You will learn how to ensure your app is flexible and maintainable, and how good, structured design can help avoid problems like browser incompatibilities. Along the way it helps you unlearn many old coding habits. Above all, it opens your mind to the many advantages gained by placing much of the processing in the browser. If you are a web developer who has prior experience with web technologies, this book is for you. Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book. Val's Blog'A tremendously useful field guide specifically written for developers down in the trenches...waiting for the killer solution...'Web users are getting tired of the traditional web experience. They get frustrated losing their scroll position; they get annoyed waiting for refresh; they struggle to reorient themselves on every new page. And the list goes on. With asynchronous JavaScript and XML, known as'Ajax,'you can give them a better experience. Once users have experienced an Ajax interface, they hate to go back. Ajax is new way of thinking that can result in a flowing and intuitive interaction with the user.Ajax in Action helps you implement that thinking--it explains how to distribute the application between the client and the server (hint: use a'nested MVC'design) while retaining the integrity of the system. You will learn how to ensure your app is flexible and maintainable, and how good, structured design can help avoid problems like browser incompatibilities. Along the way it helps you unlearn many old coding habits. Above all, it opens your mind to the many advantages gained by placing much of the processing in the browser. If you are a web developer who has prior experience with web technologies, this book is for you. Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book. Val's Blog "A tremendously useful field guide specifically written for developers down in the trenches...waiting for the killer solution..." Web users are getting tired of the traditional web experience. They get frustrated losing their scroll position; they get annoyed waiting for refresh; they struggle to reorient themselves on every new page. And the list goes on. With asynchronous JavaScript and XML, known as "Ajax," you can give them a better experience. Once users have experienced an Ajax interface, they hate to go back. Ajax is new way of thinking that can result in a flowing and intuitive interaction with the user. Ajax in Action helps you implement that thinking--it explains how to distribute the application between the client and the server (hint: use a "nested MVC" design) while retaining the integrity of the system. You will learn how to ensure your app is flexible and maintainable, and how good, structured design can help avoid problems like browser incompatibilities. Along the way it helps you unlearn many old coding habits. Above all, it opens your mind to the many advantages gained by placing much of the processing in the browser. If you are a web developer who has prior experience with web technologies, this book is for you
Web users are getting tired of the traditional web experience. They get frustrated losing their scroll position; they get annoyed waiting for refresh; they struggle to reorient themselves on every new page. And the list goes on. With asynchronous JavaScript and XML, known as "Ajax," you can give them a better experience. Once users have experienced an Ajax interface, they hate to go back. Ajax is a new way of thinking that can result in a flowing and intuitive interaction with the user.
Ajax in Action helps you implement that thinking— it explains how to distribute the application between the client and the server (hint: use a "nested MVC" design) while retaining the integrity of the system. You will learn how to ensure your app is flexible and maintainable, and how good, structured design can help avoid problems like browser incompatibilities. Along the way it helps you unlearn many old coding habits. Above all, it opens your mind to the many advantages gained by placing much of the processing in the browser.