Prototype 1.5 and the Documentation is Here
Ever since the initial announcement of the documentation effort, we’ve been busy planning and preparing Prototype for its rebirth. Along with the official 1.5 release, we’d like to welcome you to the official home of Prototype. This site will serve as the center of our community and help developers everywhere become familiar with Prototype and its continued progress.
Prototype 1.5 release
We’ve been squashing some nasty bugs getting ready for the 1.5 release. You can get the full scoop on all the fixes and improvements in the CHANGELOG.
The API gets documentation
While there has always been some great documentation on Prototype, we’ve been the victim of a famous quote from *“The Man Who Shot Liberty Valance”:
When the legend becomes fact, print the legend.
We’re moving past those times, however. We’ve worked really hard to fully document the API. This is something we’ll be improving over time, but it’s a great start. Here are some of the features:
Guessable URLs
The documentation site has guessable URLs. For instance, if you’re looking for documentation on Element.show, then you can find that documentation at a url like: http://prototypejs.org/api/element/show. If you’re looking for Form.Element.focus you can find it at: http://prototypejs.org/api/form/element/focus.
Atom feeds
Each Object has its own atom feed. This opens the doors for integrated documentation. For instance, if you want the XML file for Form.Element, you can find it at: http://prototypejs.org/feed/api/form/element/atom.xml. This feed will always contain the most up-to-date documentation for Form.Element.
Tips and Tutorials
We’ve also added an article section where you can find tips, tutorials, and a variety of articles for Prototype. We plan on adding many more articles to this area over time, so keep your eyes peeled.
A special thanks
We’ve added three new core members to our team. Chris, Mislav, and Tobie were already avid contributors to Prototype, and they were the driving force behind the documentation effort. We all worked really hard on it, but these guys deserve most of the credit.
Rough around the edges
We’re not perfect, so if you catch any spots in the documentation that are incorrect, or if you’d like to improve parts of the documentation shoot one of us an email. We’ll try to get an official email posted later so you can send in improvements or additions to the documentation. Until then, please enjoy the site!
Update: Rails 1.2 has been announced and includes Prototype 1.5 with the release! Congrats to the Rails team.
Sorry, comments are closed for this article.


Comments
This rocks! :)
Indeed it does. Very nice site, clean design and horay for the content!
thanks ;-)
Very nice ;)
This site is so much greater than the CHANGELOG in the trac ;) 1.5 is a wonderful news and a great work. You rock !
You mean I never again have to try googling ”$$()”?
Amen.
Great work gang!
Finally some decent API documentation, a great thanks to the team who put it together, i can’t live without it anymore :)
Good site for the great tool. From my point of view, top navigation isn’t easy discoverable. I searched for a Download link in content for at least a minute.
Excellent work!
I’m so happy! This made my day.
hopefully this is a start of something great! really looking forward to see how this mission progresses. All the best of luck guys!
Thanks very much for all of your work!
Now we have to hold out hope for Script.aculo.us getting some real documentation; It’s as if people don’t want us using their products!
Well done on the great documentation, I’ve already discovered the ease of using Templates that I had missed before.
finally – thank you. (the link to the changelog doesn’t work “You can get the full scoop on all the fixes and improvements in the CHANGELOG.” =>No node /spinoffs/prototype/CHANGELOG at revision 5997) and please get a favicon so i can find you in my tab-chaos ;-)
Great work guys, every bit of your effort is very much appreciated. I can’t wait to get started and see what I’ve missed along the way.
Thanks for the heads up. The CHANGELOG link should be working now.
The URL for the changelog changed on Tuesday when Sam reorganized the repository (to add the standard “branches,” “tags,” and “trunk” folders). That was sneaky of him. :)
Justin – awesome work as always!
This is great work (very luxurious)!
Congrats! this is fantastic news.
Great new site to go with your visionary library!
Freekin awesome! Thanks.
Congrats on the new site. At last! The documentation has been released
Thanks!
Awesome! Thanks again, Prototype!
I think it’s great that you have updated your site. The one thing that I would really like is for you to add forums. They seem to be so much easier to use and search for things than mailing lists. There really isn’t a good forum for prototype on the web…
Also…. I am confused why you don’t use much prototype on this site? It might make going through the api docs more fun :)
Thanks for the great library!
Thanks! The new site looks great, as do the docs. I’m looking forward to looking through the ‘Learn” section; hopefully, that’ll encourage me to use Prototype on some of the stuff I’m working on. I’ve been meaning to look into it for some time, and this removes just about any excuse I could use to excuse myself from learning Prototype.
Good work.
This is wonderful! I would love to contribute to a code-snippet collection for prototype-based widgets (or as other JS libraries call them “plug-ins”). Would it be possible to set up such a collection here? Or is there another place we should gather our prototype-based scripts?
Hey guys – been using prototype since 1.4 as a framework for a major media website. It’s always been rock-solid. I wanted to make sure that 1.5 is backwards-compatible – I assume that it is? Perhaps a mention of that somewhere on the site would be warranted.
Uncle Billy: There is a simple change that you’ll need to do (assuming you’ve written code like this).
It’s always wise to test the upgrade in some kind of staging environment too if possible.
Nice job guys. I haven’t seen the docs yet, but will get to them after this comment. I’ve been reading about Yahoo!’s UI and jQuery and subconsciously comparing the syntax with Prototypes. I don’t know what it is, but I really “get” Prototype much easier than the other’s I’ve researched. So, it’s nice to see that the documentation is coming along.
I just created a really simple bookmarklet based upon the guessable URLs
Create a new bookmark and set its location to: javascript:p=prompt(“View docs for?”);p=p.replace(/\./g, ”/”);window.location=”http://prototypejs.org/api/”+p.toLowerCase();
You can then add this to your quick launch or assign it a keyword shortcut in FF.
It prompts you for the code snippet you want to search for, using the example above: Form.Element.focus and then redirects you to the correct (hopefully) page in the documentation which in this case would be: http://prototypejs.org/api/form/element/focus
Nothing mind blowing but is a handy shortcut to have :)
Freakin awesome. Congrats all involved. Hopefully this will bring around a very active community of developers! I’d love to know if the scripts I’m making pass muster with this very smart group.
With a more complete documentation, we will consider using Prototype more extensively. Thanks for everyone’s effort.
Nice Page~ Thanks~ :)
wow ! a blog ! great ! and thanks for the release ^^
Greate work! Thanks, many many thanks.
http://prototypejs.org/api/template
doesn’t display some of the custom syntaxes code in Safari Version 2.0.4 (419.3). It’s displaying: var syntax = /(|.|\r|\n)(\’ var t = new Template(‘Name: <= name %>, Age: <=age%> ’, syntax);
t.evaluate( {name:’John Smith’, age:26} ); // -> Name: John Smith, Age: 26
Here’s the fix for it: var syntax = /(|.|\r|\n)(\<=\s\s\>)/; //matches symbols like ’<%= field %>’
Sorry, my previous comment didn’t display correctly either:)
var syntax… line just need to html encode the less than and greater symbols.
Wow. Amazing. I never thought that this day would come. Finally there is official site for Prototype and documentation is included! Just Amazing!
Thank you!
good work! 10++
Joey, that should be fixed now.
Thanks for the heads up.
Finally. this site is a godsend
I really like the work on the documentation, but compared to Sergio Pereira it took my longer to find things.
Why? Simple because the one page approach from Sergio really works very well. You everything on one page, just use your browser to search inside the page and it’s there. Right now here isn’t even a search implemented. I also need much more clicks to find something because I can’t search easily across pages.
I also think that the content of the API Docs start page should more interesting things like, some kind of overview or most common used practices, etc, not some boring paragraphs actually bringing nothing of importance to the reader.
I highly appreciate the works into a good Prototype documentation, I just don’t think that this result is something practical to use to find things fast.
Awesome news! Good luck to the site :)
First off, this is very welcome.
It’s obvious that a huge effort has been put into this and it really has paid off.
Great design and great documentation.
Markus, once google has indexed the site you should have no problem finding things quickly, although I agree a search across the api would be helpful.
Apart from that a very well done to all involved.
Just marking up Aaron’s bookmarklet:
Excellent news. Congratulations on the new release/site/blog and most of all THANKS for the documentation. Oh, and I’d vote for doc search too.
Markus, nice feedback and suggestion. We’ll take it into consideration!
the long wait is over!
Hi,
using prototype just got even easier. Great work!
Thanks, Walter
API search is coming soon, it just didn’t make it on the first round because of technical issues.
I’ve released a compressed version that shrinks prototype.js down to about 30K, 14K if you factor in further gzip compression from the web server.
http://www.stevekallestad.com/blog/prototype_150_compressed.html
I usually release a compressed version pretty quickly.
Great work!!!!
Thanks for the API doc!!
Thanks for including the documentation. Now all will be much easier to develop. Great work :)
Finally… there’s a place to stop by while searching for docs. I really learned a lot from Sergio Pereira’s site, but it was stuck at version 1.4. This is much better.
Thanks!
Weeeeee ;)
Finally! :) This is really great and will silence the critics of the prototype library (esp for documentation) for some time :)
Awesome, It may have taken a while coming but looks worth the wait. Prototype is an amazing piece of work and now we have a community and proper documentation.
Cheers to all involved.
I cannot coding without prototype
Great JOB :)
Congratulations on the new website!! So far it looks very smashing ;-)
..oh, and prototype r0x!
Nice start :) So now we have place to discuss about prototype!
1. It will be great to add “comments” to documentation (like in PHP manual or other online manuals)
2. Compiled manual, i mean .chm. Yes we can do it by download whole pages… but..
3. What about multilanguage support (at least for manual), as i know very much non-english people do it already, so it’s a good place to join them all..
4. Links to “plugins”, yes, many people do it already, but it’s extremaly hard to find :)
5. When prototype.js will handle “real onload”? I mean something like this:Thanx :)
Ahh yes, finally!
Can anybody explain me why
Array.eachandHash.eachuse iterators with different signatures?So that iterator’s signature depends on iterable object it’s applied to. Why not to make Hash’s each the same as Array’s one?
A hash is a key/value pair, where an array is a value with an index.
For instance, you can do this with the Hash:
Can you add a downloadable version of documentation+tricks ?
thanx for your excellent work !!!
Thanks for a great framework! You guys should win a Nobel price!
Awesome work! thanks!
API Docs? I can’t believe it :)
Your articles section needs a printer friendly version! It puts the blue lines down the sides of my pages and wastes tons of ink on backgrounds and extra pages.
Alex, thanks for the swift kick. :-) I completely forgot about a printer friendly stylesheet. I’ll get it in soon.
Cool…the long awaited stuff is live now…!!! A moment to cherish…Good job…
Great! I’ve been using this library for many months and never regreted that!
good job guys, looks like a good start into the new year ;)
This is just great news! Many thanks! (the design is lovely, btw)
So we could traverse different structures with the same iterator.
What’s the reason to not implement such an interface?
that rocks
What’s the purpose of the iterator in your first example? If you want to use an argument for every key in a hash, there is no need to iterate over them.
You don’t even need the $H() wrapper, your just accessing known keys.
obj.name, obj.age
I think your misunderstanding Objects vs. Arrays. What if you had 3 keys? How would you use the same iterator? Arrays and Hashes are different data types, and thus require different iteration mechanisms. One is a collection of key/value pairs, the other is a collection of values, each with an numerical index.
site seems slow to me.
I think that might have something to do with the 60,000+ page views and 16,000 unique visitors we’ve had already today. :-)
This rock!
Good job to everyone who helped get this up. No more code hunting ;-)
Thanks.
Lack of documentation and a sold development team has long been an arguement against propotype, but we see now that there was a lot of work behind the scenes,
You’ve just helped me make up my mind on important decisions.
Trying to write a workable textmate command to search the new API. Is there a chance you guys will make a quick go-to command, so I can just do http://prototypejs.org/api/getElementsByClassName instead of http://prototypejs.org/api/element/getElementsByClassName
If we had that, the command would be a simple onelines, taking the current word and popping it at the end of the url. With the class name as a requirement in the url, I’ll have to change the scoping all around or create some sort of lookup table or something to match the method names with the class names.
Thank, great stuff!
Hello, I have a problem that is related to what is described on http://prototypejs.org/api/array . I use multiples scripts and one of them uses Prototype but others not. The others (those I can’t change) have problems with the Array class because they use for…in loops to browse thru the array values. Consequently the function without of the Prototype’s Array get called unintentionally. I’m wondering whether there is a work around I can try knowing that right now I can’t change those scripts? Thanks in advance, Louenas
Do you plan to put up e-mail notification about changes in the docs?
@Thomas: Great to hear your working on something for Textmate!
On your point…Unfortunately we can’t really do that. Mephisto would regognize /getElementsByClassName as a section, when in fact, it’s a page.
I had some ideas about doc tooltips in Textmate by pulling down the atom files for the sections. We put the syntax and a short blurb in the excerpts with the intentions of doing just that.
@louenas: Not much you can do about that. See Andrew’s post on that topic.
@Kjell Bublitz: ATM, there are no plans for this. You can, however, subscribe to a section feed and tell your feed reader to mark updated items as unread. I know most Mac feedreaders have this feature.
i heart prototype.
2Justin Palmer: probably, my misunderstanding you talking about is based on using php+json to pass data from server into javascript on client.
As known, arrays in php can have not only numeric key but text ones as well. And json transformation I use works in the following way: - if array keys are 0, 1, 2 … and so on, it creates a javascript array; - but if they are not (let’s say “foo”, “bar”, “baz”... or even 1, 2, 3 (not a zero-based array)), it will create an object with corresponding properties.
So the iterator I have to use on client side depends on is the data passed a zero-based array or not. That’s what I meant.
Anyhow, thank you for the explanation.
“off-line” API Documentation (CHM file) http://rapidshare.com/files/12532650/Prototype_Javascript_Framework.zip :-)
@visor: Do you mind putting that in a more sane area? The requirements to grab the CHM file are discouraging.
If you don’t have the hosting, we can put it up here if you don’t mind?
Thanks Justin. I’ve already red the Andrew’s post but it doesn’t help in my case. You know on Firefox it doesn’t behave the same as in IE i.e. the for..in loop iterates only over the values not the properties in Firefox. Is there a way to reduce the scope where of the extended Array? Thanks for your help Louenas
Heya.. and here comes my interpretation of an offline version :) Worked on this the whole night, plus this morning for the other half. Damn.. didnt know this framework growed so heavy. ^^ I marked up as good as i could and followed the same style as currently online available.
http://www.m3nt0r.de/devel/Prototype.chm
enjoy!
Well, I am a long time fan of Prototype, but after I read the documentation created by sergio. This one simply rocks.
Kjell Bublitz, Kudos for your effort. I was aggresively looking for an offline version… Hats off.
This is a compressed version of stable 1.5.0, that really works in all current browser without console errors – tested in Firefox/bird, IE5.5+, Opera8+:
http://aka-fotos.de/research/prototype/js/prototype1.5.0c.js
It’s compressed with Dean Edward’s packer and is based on a cleaned version with all necessary ”;”s and some little adaptations. So use this one, if you are goin to compress it yourself:
http://aka-fotos.de/research/prototype/js/prototype1.5.0clean4Compression.js
Yeah, 29 kB are much better than 73.
Andi
@Justin Palmer: of course you can put it on your site! :)
Thanks everyone for this extensive documentation on Prototype. This will help me out in knowing more about this.
Prototype is great!!!!!
PS : Thanks Kjell Bublitz for the offline documentation.
Amazing ! Great ! I can’t code without prototype or with difficulties ;-)
phenemonal!
i’d love to see more, myriad examples though….
Great!! I love the documentation!!!
By the way – is there any chance that the next version(s) can be minified? I know that JavaScript makes curly braces optional for one-liners, but it makes it tough to have a smaller version of the script. I’ve home-spun my own version of 1.5.0_rc1 to make it smaller and reduced the file down to about 40kb.
Thanks!
Hi.
This is the most fantastic site. ;)
I waiting for a widgets community based in prototype for advance treeview, combo box, windows, tab panel, etc.
Excellent job.
Excellent material.
Thank’s for this beautiful job.
Mario
Thanks so much for the documentation.
One question.. You have a serialise form function..
Is there anyway to have a serialised array of object.
For instance – a grid has a row of control and you want to send that row off to the server.
You can put the controls into an array but how do you then send them to the server?.
Take Care Dave
Hi Justin :o)
Any chance of a packaged documentation? Say a ZIP file?
I’d really love to be able to spend a weekend on my laptop somewhere without having to connect to the internet (wireless in Australia is expensive!)...
Cheers :o) Richard
Tanks!!!
Great, it’s about time! I think the library will be WAY more popular amongst juniors if you get some serious docs on it…
@Richard: You are aware that you can right click the link to save? Or for that matter click File->Save in your browser or copy it into those Text Editors we always have open.
Will there be a forum soon? I’ve found a problem with 1.5 and the $ function (vs 1.4 which works fine) but I’m apparently not technically savvy enough to isolate the issue on my own.
I still want to make sure my comment gets in here. Just wanted to say congrats to a beautiful API documentation site and relaunch of Prototype. This was a giant leap and you guys are totally kicking ass. Congrats!
You can download the entire API documentation from http://aprasadh.googlepage.com.
help me!
Excellent! Keep up the good work!
Maybe it is a silly question, but I cannot get this to work (Win XP, Apache, IE 6):
(url don’t get any data, either with $H() or not; but if parameters are passed in a string of key-value pairs separated by ampersands, everything works as expected). Did I miss something? I appreciate your help and suggestions
Disregard previous post. I was using kind of beta prototype.js. My mistake, sorry.
plese give the detail example of the api documentation
hey, look this file http://beta.bigmedium.com/bm~doc/prototype-api.pdf is a great work for the documentation of the api
有没有更加详细的文档???
The docs has no samples?
COOL SITE & INFO !!!
I cannot find your license file anywhere. The code itself refers to an “MIT style” license but nowhere do I see the actual license file itself. I’m very interested in this javascript library but my corporate legal won’t let me touch it until they can review and approve the license file.
So… can you tell me where I can find it? It really really REALLY should be a link off the main page.
a great tutorial!, but its necessary more exercises or free scripts, thanks.
Why on older versions of mozilla does the status bar say…. “Waiting for www.mydomain.com” whenever I make a call using your script… it sits and waits for something…and goes away once you refresh the page.
Is there anyway to kill the connection, it seems to stay stuck open with older mozilla… im using your basic example.