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.
Conversation
Thanks for this Jonathan - love your cheat sheets!
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!
Awesome, thanks Jonathan!
Great man. Thanks a lot. Have you ever thought about creating some kind of Prototype cheat sheet widget? :)
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? ; )
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... :)
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!
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).
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.
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 ; ).
Wow. This is nice. Thanks loved it.
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.
Thanks a lot!
this certainly will come in handy!
great work. keep it up.
cheers pmd
Hey thanks a lot this will help me rebuild my site.
This is an awesome resource! Thanks for putting this together. I have already pointed many students to your website. Much appreciated!
Marko
What would be even cooler is if the function names in the cheat sheet linked to the api pages on prototypejs.org
Its a great work Jonathon. Thanks alot
Ah nice find here. Thanks a bunch Jonathan. I am just about to print it out!
wow..its really nice to see graph of scripts..
thx Jonathan !
Thank you! This is very helpful.
keep up the your great work.
thank you.
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
great work man.It's good to see these.
Thanks a lot. Very Helpful cheat-sheet
In your examples of querySelectorAll(), the element.querySelector($this->normalizeEntities16bit("8221")p:first-child$this->normalizeEntities16bit("8221")) code can be written: element.querySelector($this->normalizeEntities16bit("8221")p$this->normalizeEntities16bit("8221")) 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.
How do i use JavaScript
Prototype 1.5.0 Cheat Sheet ???
The New Cheat Sheet is Here:
http://www.prototypejs.org/2008/1/29/prototype-1-6-0-2-cheat-sheet
cool stuff! I was looking for some simple help document on Prototype and this looks a perfect summary.
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?