Upgrading to Prototype 1.6: real world examples
by
Sam Stephenson
| October 21st, 2007
Prototype core developer Mislav Marohnić recently patched the open-source CMS Radiant to take advantage of the many code-saving features in Prototype 1.6.0, and he’s written an informative description of the process on his new blog, No Strings Attached. Mislav’s writeup covers the migration from Prototype 1.5.0 to 1.6.0, with examples of how to use the improved DOM and event APIs and upgrade to the new Hash API. The final release of 1.6.0 is just around the corner, so be sure to check out these nuggets of wisdom as you upgrade.
Sorry, comments are closed for this article.


Comments
Great examples!
I would really like to see more “real world” examples/snippets in the documentation.
The docs should tell the user both how a method/function works, and why you should use it.
I’m a newbie in js. I have used this framework and felt very interested with it. And I wonder how can you do this syntax : $(‘id’).hide () ? In general is : func1([param]).func2([param]).func3([param])... Plz put a simple example here about how to do it. I had view src and understand nothing :P
Sorry to put question here, but I cant find anywhere to ask
Regard
I think Mislav has made a damned good job and also killed some bugs not only improving speed. it looks for me like a new “milestones”, thanks for the update-info sam.
with best regards, Maya @ dmp|cda
On mislav’ site there is example: // before: Element.removeClassName(row, ‘children-visible’); Element.addClassName(row, ‘children-hidden’); // after: row.removeClassName(‘children-visible’); row.addClassName(‘children-hidden’);
This could be even shorter: row.removeClassName(‘children-visible’ ).addClassName(‘children-hidden’);
For this new code:
initialize: function(element_id) { $(element_id).select(‘tr’).each(this.setupRow, this) }
Will there be a script error if the tr element does not exist? Or what if “element_id” does not exist? Should I be checking it first?
Thanks, www.site-assist.com