Prototype 1.5.0 Cheat Sheet

I've gone through and detailed the methods and properties of each of the modules within the Prototype JavaScript library.

I decided to revisit the cheat sheet. A couple people had been asking about it and with the final release of 1.5.0 just around the corner, now seemed as a good a time as any. I've done things a little differently this time. The first time around, I really just wanted to see how everything was connected and what did what. This time, though, I wanted something a little more practical for me.

  • First, I've included possible parameters. I've used a shorthand to try and fit everything in, so I hope it's clear. Pretty much anytime a function is passed in, it's for a callback. Anywhere a parameter needed a little more explanation, i included a word before it to describe it.
  • Secondly, I've dropped some base classes and internal properties or methods. Some of the stuff only serves a purpose within Prototype and it was just clutter to include it in here.
  • I've done this up in Illustrator instead of Fireworks to ensure that the PDF version would be clean and clear. I realized a desktop version was somewhat annoying; at least, for me it was.

Downloads

Published January 10, 2007
Categorized as JavaScript
Short URL: http://snook.ca/s/750

Conversation

32 Comments · RSS feed
Kieran Huggins said on January 10, 2007

Thanks for this Jonathan - love your cheat sheets!

Lorenz said on January 10, 2007

great! it's always easier to get more in touch with the new version of prototype, if you have such a nice cheat-sheet!!!

thank you so much!

Bramus! said on January 10, 2007

Awesome, thanks Jonathan!

Wolfgang Bartelme said on January 10, 2007

Great man. Thanks a lot. Have you ever thought about creating some kind of Prototype cheat sheet widget? :)

Felix Geisendörfer said on January 10, 2007

Hey Jonathan, what would I need to do in order to convert you to become a jQuery follower? What reasons do you have to stay with prototype having the elegance of the little J directly in front of your eyes? ; )

Jonathan Snook said on January 10, 2007

Felix: What's interesting is that I'm using Prototype less and less. I've been using YUI more and more. jQuery does seem well done and maybe one day I'll get into it... :)

Robert said on January 10, 2007

Thanks for the cheat sheet! Alltough cake has very nice ajax helpers, sometimes you need to do it yourself and this helps me a lot!

Andy Kant said on January 10, 2007

Nice cheat sheet, you should make one for Mootools. ;-)

Prototype is a great library, I haven't been using it much anymore because I like how compact Mootools is (plus most of the time I don't make use of all of the extra functionality, I just code my functionality myself).

I need to try jQuery yet; I've been hearing a lot of good things. The only reason I haven't touched it so far is because it starts with a J (ironically the same thing that Felix thinks is elegant ;-). The "J[insert name]" to me makes me think Java, and I hate Java with a passion (me and Java, we had some bad experiences together, mostly Java decided to be a douche and I decided it should burn in hell).

Cory said on January 10, 2007

Thanks a lot for the cheat sheet! I recently picked up MooTools and have been using it as of late, but this should still come in mighty handy with another couple of projects in the near future.

I am looking forward to the new release so I will certainly keep this file handy.

Felix Geisendörfer said on January 11, 2007

Jonathan: Yeah I think YUI does a better job of providing 'a framework' for client side scripting then jQuery does, so I can see why one would use and like it. However, jQuery's elegance in traversing and manipulating the DOM is something YUI does not even come close to. So even if you want to stick with YUI, take some time to play around with jQuery, you will not regret it. You should even be able to use it together with YUI (jQuery is only ~20kb) without any issues.

Andy: jQuery and Java share nothing more then their first letter. I mean jQuery is the polar opposite of the Java philosophy. The best description for it was posted on the jQuery mailing list a while ago and is now on the jquery.com front page:

"You start with 10 lines of jQuery that would have been 20 lines of tedious DOM JavaScript. By the time you are done it's down to two or three lines and it couldn't get any shorter unless it read your mind." - Dave Methvin

If you think that sounds like hype - it's really not. When switching from Prototype to jQuery I found myself using less and less code while doing more and more cool things with the DOM ; ).

Alright, enough jQuery evengalism for today, give it a try and I'll give you a "money back" guarantee if you don't like it ; ).

Filipe Rocha said on January 11, 2007

Wow. This is nice. Thanks loved it.

Andy Kant said on January 11, 2007

Felix:
Yeah I know it doesn't have anything to do with Java, its just a stigma I have towards names beginning with a J. They remind me of the countless debugging nightmares I've had with Java in the past. I'd rather debug ASM than Java.

I'll have to play around with jQuery later though, I'm working on a new web interface for Xbox Media Center that is fairly DOM-intensive that it might be useful for.

G100g said on January 11, 2007

Thanks a lot!

Richie said on January 14, 2007

this certainly will come in handy!

pmd.at said on January 15, 2007

great work. keep it up.
cheers pmd

Sam said on January 30, 2007

Hey thanks a lot this will help me rebuild my site.

Marko Gargenta - Marakana said on February 22, 2007

This is an awesome resource! Thanks for putting this together. I have already pointed many students to your website. Much appreciated!

Marko

Meekish said on March 17, 2007

What would be even cooler is if the function names in the cheat sheet linked to the api pages on prototypejs.org

Hamidreza Tavakoli said on April 16, 2007

Its a great work Jonathon. Thanks alot

Tim Koschuützki said on June 16, 2007

Ah nice find here. Thanks a bunch Jonathan. I am just about to print it out!

Yash said on July 06, 2007

wow..its really nice to see graph of scripts..

monica said on August 02, 2007

thx Jonathan !

Greg Swindle said on September 13, 2007

Thank you! This is very helpful.

NBA said on September 17, 2007

keep up the your great work.
thank you.

reza said on September 18, 2007

11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

kredi said on September 19, 2007

great work man.It's good to see these.

satts said on October 01, 2007

Thanks a lot. Very Helpful cheat-sheet

cam said on October 13, 2008

In your examples of querySelectorAll(), the element.querySelector(”p:first-child”) code can be written: element.querySelector(”p”) because only the first paragraph is returned for each li element.

If I decided not to support IE5 and prevent it trying to process the code, to prevent an error would you advice an excluding conditional comment or a JavaScript sniff to achieve this? I have not been successful with excluding IE5 with conditional comments and also achieving strict markup validation.

leevan said on October 16, 2008

How do i use JavaScript
Prototype 1.5.0 Cheat Sheet ???

SMHMayboudi said on December 28, 2008

The New Cheat Sheet is Here:
http://www.prototypejs.org/2008/1/29/prototype-1-6-0-2-cheat-sheet

Kamal said on January 13, 2009

cool stuff! I was looking for some simple help document on Prototype and this looks a perfect summary.

Yoav said on January 14, 2009

Hi Jonathan

I'm not really into Prototype, but I was looking for a good PDF Cheat Sheet layout and stumbled onto yours. I am working on some Excel cheat sheets and I was wondering whether I can borrow your layout?

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.