jQuery Prototype Library – A Polygamous Affair

I have something that I must confess... I'm in love with two JavaScript frameworks at the same time.

Yep, I'm in love with both jQuery and Prototype. Each has qualities that I like and each some that I don't. jQuery, for instance, is almost beautiful in its design and how such a simplistic approach can be made so powerful. Prototype, on the other hand, adds so much that is missing in JavaScript and makes an already capable language much more usable.

In a perfect world, I'd want to use both of them. The problem is that there is too much overlap in the capabilities of these frameworks to warrant using both of them on the same project.


I have decided recently that I cannot live without both frameworks. I love jQuery but I also want Prototype's additions to the language. I finally figured out that what I wanted was a stripped down version of Prototype; one that is specifically designed to play nice with jQuery.

Downloads

The following links are the result of this attempt to add Prototype-like functionality to the jQuery framework (removing anything resembling any functionality that is already available in jQuery). And not bad too, the end result came in at about 20KB (as compared to the 120K for a copy of an unpacked and unminified Prototype).

Caveats

Though most of the remaining methods are largely unchanged, I took the liberty to remove any of the objects or methods that I did not want (or were redundant aliases). In addition, I took the liberty to make a few minor changes to a few things that I'd prefer named or written another way (you'll have to review the library yourself as I did not take the time to document these). For example, I changed the name of the 'initialize' method utilized by the Class object to '_init'. A breaking change for anyone wanting to use this as a direct replacement to Prototype, but it is something that I wanted named differently.

I hope you find it useful... and many thanks to the Prototype and jQuery devs for creating two outstanding pieces of code (your efforts are greatly appreciated).

Leave a Reply

(will not be published)