Looking for another approach?
One size does not necessarily fit all. Although it is my fervent hope that the very vast majority of the book’s readers found it to their liking and very useful to their endeavors, it never hurts to cross multiple approaches in order to get a better understanding of a topic.
Which is why I couldn’t be silent on the recent release of fellow Prototype Core member Andrew Dupont’s book, Practical Prototype and script.aculo.us. Amazon has Search-Inside already, and you can grab a free chapter at Ajaxian.
You’ll notice Amazon pairs Andrew’s book and mine more often then not
Andrew’s a superb Prototype expert, one of the four people, actually, having commit rights to Prototype’s repository. He’s extremely active (far more than I these days, I’m afraid) and I have every confidence his book is very useful. Check it out!
No commentsGetting Out of Binding Situations in JavaScript
I’m delighted to report that my article in renowned A List Apart just went out, and it covers a pretty tricky aspect of JavaScript often misunderstood or poorly known: binding.
Head over to ALA and enjoy: Getting Out of Binding Situations in JavaScript.
2 commentsFirefox 3’s out!
Get it now. I’m serious. YSlow’s there, Firebug 1.2 beta’s there, Web Developer Toolbar’s there, and it just kicks the living crap out of Firefox 2 for performance, not to mention all the cool dev-oriented stuff like more advanced JS, better extension stuff, better <canvas>, better SVG, better support for cutting-edge standards, and the like.
Get it now. Get it today.
3 commentsRich autocompletion
A few days ago, an astute reader of the book, Bharat Ruparel, requested an example of multiple-update autocompletion on the book’s forums. I thought it would make for a nice demo page and a post here, so here you go, Bharat.
The main idea behind autocompletion with script.aculo.us is that the possible results are sent as a <ul>/<li> list, one list item per result, and the full textual contents of an item (including line breaks and whitespace), except whatever contents sits inside an element with a CSS class named “informal,” are extracted to provide the completed text.
This behavior can be altered, however, mainly through two means:
- Using the
selectoption to provide a CSS class name marking which textual contents to use (any other textual contents will be ignored) - Providing a custom extraction logic in addition to the default one through the
afterUpdateElementcallback.
Both these are discussed in the book (chapter 16, which is 20 pages), but the callback approach isn’t demonstrated in-depth. For this post, I prepared a detailed demo page that I invite you all to go through. It contains detailed explanative material around each step, from the most basic call to the full-fledged one, and tries to demonstrate the snags you can hit and how to achieve more advanced completion.
I hope this helps, and perhaps even provides a few of you with that “Aha!” moment I cherish.
Cheers,
No commentsBuilder demo errata
A reader just brought an issue with the book’s Builder demo (chapter 17) to my attention.
The code that ships with the demo essentially grabs code pieces from the page itself, where they are displayed in table cells, to run this code live and display its result. In doing so, it attempted to go the extra mile and strip single-line comments from the code before eval‘ing it; it isn’t mandatory, it just felt cleaner at the time.
However, the regular expression used b0rks on IE7. I’m surprised nobody alerted me to that in almost 7 months since the book’s final release…
To get it to work in IE7, simply strip the clean-up line from the code. That’s the following line:
code = code.replace(/^\s*\/\/.*$/mg, '');
This will work just fine on all browsers now.
Thanks to Bharat for the heads up!
No commentsNeuron Workout Solutions #6
Welcome to this sixth installment of Neuron Workout Solutions™, a series that answers the questions and challenges at the end of many chapters in the book. Boy, is this installment overdue. I’ve been meaning to write it for weeks, but life just didn’t seem to agree. Today we’ll address the challenges closing chapter 12: Effects. And with this, we open up the Neuron Workouts for the script.aculo.us part of the book.
No commentsReprint!
The original 5,000 paper copies are just about sold out, and channels keep asking for more! So I’m happy to announce Pragmatic Programmers just triggered a reprint of 3,000 more copies.
Thanks to everyone for grabbing the book, I hope you’re loving it!
No commentsSorry for the outage, folks
For the past 24h or so, this web site was not accessible, due to a principle of precaution when some potential security issues arose, in order to protect the visitors’ privacy.
Unfortunately, this coincided with a major office rush, hence the long fix.
Thanks for hanging in, and welcome back.
3 commentsJavaScript Nuggets #1
This post opens up a new series on The Bungee Blog, called “JavaScript Nuggets.” In this series, I shall attempt to share with you a few bits of code I have been using and refining over actual projects, bits that I find myself reusing all the time, which means I’m happy enough with them.
Today we’ll talk about two generic functions I use in most of my backoffice screens to consistently “ajaxify” checkbox lists (persisting the checked ones on-the-fly, without needing to submit anything) and deletion of list items (with proper, dynamic confirmation dialog boxes).
4 commentsHook up at The Ajax Experience 2008

I’m delighted to report I’ll once again speak at The Ajax Experience, in its unique 2008 edition, to be held in Boston from Sep 29 to Oct 1, 2008.
I’ll hold a session named “What’s Up With Prototype and script.aculo.us,” that will showcase all the latest stuff in both libraries.
It’s going to be exciting for sure, especially with RailsConf USA offering so little in the way of client-side stuff…
Last time was a blast, so I look forward very much to this! If you attend, be sure to come and say hi!
No comments

