|
Ajax in Action Dave Crane and Eric Pascarello with Darren James October, 2005 | 680 pages ISBN: 1932394613 |
|||
![]() |
$22.50 | PDF ebook | |
![]() |
$44.95 | Softbound print book | |
Preface
Sometimes your destiny will follow you around for years before you notice it. Amidst the medley of fascinating new technologies that I was playingI mean workingwith in the early 1990s was a stunted little scripting language called JavaScript. I soon realized that, despite its name, it didnt really have anything to do with my beloved Java, but it persistently dogged my every step.
By the late 90s, I had decided to cut my hair and get a proper job, and found myself working with the early adopters of digital set-top box technology. The user interface for this substantial piece of software was written entirely in JavaScript and I found myself the technical lead of a small team of developers writing window-management code, schedulers, and all kinds of clever stuff in this language. How curious, I thought. Itll never catch on.
With time I moved on to more demanding work, developing the enterprise messaging backbone and various user interface components for an intelligent, talking House of the Future. I was hired for my Java skills, but I was soon writing fancy JavaScript user interfaces again. It was astonishing to find that some people were now taking this scripting language seriously enough to write frameworks for it. I quickly picked up the early versions of Mike Fosters x library (which youll find put into occasional action in this book). One afternoon, while working on an email and text message bulletin board, I had the weird, exciting idea of checking for new messages in a hidden frame and adding them to the user interface without refreshing the screen. After a few hours of frenzied hacking, I had it working, and Id even figured out how to render the new messages in color to make them noticeable to the user. What a laugh, I thought, and turned back to some serious code. Meantime, unbeknownst to me, Eric Costello, Erik Hatcher, Brent Ashley, and others were thinking along similar lines, and Microsoft was cooking up the XMLHttpRequest for its Outlook Web Access.
Destiny was sniffing at my heels. My next job landed me in a heavy-duty development role, building software for big Tier 1 banks. We use a mixture of Java and JavaScript and employ tricks with hidden frames and other things. My team currently looks after more than 1.5 million bytes of such codethats static JavaScript, in addition to code we generate from JSPs. No, Im not counting any image resources in there either. We use it to develop applications for hundreds of operators managing millions of dollars worth of accounts. Your bank account may well be managed by this software.
Somewhere along the way, JavaScript had grown up without my quite realizing it. In February 2005, Jesse James Garrett provided the missing piece of the jigsaw puzzle. He gave a short, snappy name to the cross-browser-asynchronous-rich-client-dynamic-HTML-client-server technology that had been sneaking up on us all for the last few years: Ajax.
And the rest, as they say, is history. Ajax is generating a lot of interest now, and a lot of good code is getting written by the people behind Prototype, Rico, Dojo, qooxdoo, Sarissa, and numerous other frameworks, too plentiful to count. Actually, we do try to count them, in appendix C. We think weve rounded up most of the suspects. And Ive never had so much fun playingI mean workingwith computers.
We have not arrived yet. The field is still evolving. I was amazed to see just how much when I did the final edits in September on the first chapter that I wrote back in May! Theres still a lot of thinking to be done on this subject, and the next year or two will be exciting. Ive been very lucky to have Eric and Darren on the book piece of the journey with me so far.
We hope you will join usand enjoy the ride.
Dave Crane
DESCRIPTION
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.
"What is Ajax?"
Get a taste of what Ajax is all about by viewing one of our original screencasts.
Choose to watch the entertaining and informative four minute overview or view the more detailed demonstration in our twenty-two minute
screencast. It defines Ajax and builds a working example with rich features you can learn to create for your users.
What's Inside
- Ajax principles
- Why Ajax design patterns matter
- How to avoid Ajax pitfalls
- Examples of Ajax in action: type-ahead suggest, live searching using XSL, and many more.
- Examples using Ajax frameworks: Prototype, Scriptaculous, x and Rico
- Ajax usability, security, and performance
ABOUT THE AUTHORS...
Dave Crane has pushed the boundaries of DHTML, and latterly Ajax, on digital TV set-top boxes, in home automation and banking and financial systems. He lives in Gloucestershire, UK. Eric Pascarello is an ASP.NET developer and a moderator of the HTML and JavaScript forum at JavaRanch. He lives in Laurel, MD. Darren James is the architect of the opensource Rico project. He lives in Sunnyvale, CA.

