i used to use them, i like the architecture of Prototype.
but they all have too much bloat and incompatibilities as a result.
i recommend making your own from scratch.
you learn a lot about javascript and various browsers by doing so.
here is the basis of most of my apps:
Code:
if (!Array.prototype.map) {// from http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:map
Array.prototype.map = function (fun) {var len = this.length;if (typeof fun != "function") {throw new TypeError;}var res = new Array(len);var thisp = arguments[1];for (var i = 0; i < len; i++) {if (i in this) {res[i] = fun.call(thisp, this[i], i, this);}}return res;};}
if (!Array.prototype.filter) { //from http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:filter
Array.prototype.filter = function (fun) {var len = this.length;if (typeof fun != "function") {throw new TypeError;}var res = new Array;var thisp = arguments[1];for (var i = 0; i < len; i++) {if (i in this) {var val = this[i];if (fun.call(thisp, val, i, this)) {res.push(val);}}}return res;};}
function el(tid) {if (tid.nodeName) {return tid;}return el._ts[tid] || (el._ts[tid] =
document.getElementById(tid));}el._ts={};
rarely do i need much else in the way of stock code.
if you don't know about Array.map, you owe it to yourself to check it out.
__________________ my site (updated 5/13) STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
prototype is pretty ok , i found it has very nice methods, jquery is ugly i have never seen a more mutilated piece of javascript and aside all its stupid slow, fast methods that have plague the internet..
I started out with my own (having become very proficient with js), but later tried on YUI for size for a while.
I ultimately found jQuery to be a better option, due to its intuitive, selector-based syntax and it's now my default framework/mindset for any project with enough js to make using a framework worthwhile.
It wasn't that I didn't like YUI, per se.
I just felt that jQuery's level and kind of abstraction made for a smoother, quicker workflow for me, particularly given that I spent much of my (working) time nose-deep in CSS anyway.
It seemed alien at first, but quickly came to feel more intuitive than YUI.
I even tried add-ons for YUI which gave it support for selector-based DOM selection, but jQuery felt more robust.
what plugin/features are you using more out of jquery ?
Of those I do use, 'easing' is possibly the most frequent.
However, I find that I can achieve most of the techniques I'm inclined to use without the need for additional plugins - which, for many simple taks, only serve to bloat the code. After all, plugins only really serve to supply an API/abstracted front-end for tasks which can all be achieved using the main jQuery library (combined with some good, ol' W3C DOM-scripting and js core), but which might make the techniques more approachable (packagable) for those without a good understanding of DOM logic.
I use prototype, the available functions and options are huge, and I use it along side script.aculo.us which is the best effects library, it offers a lot more than just static effects and very specific options, slider, controls, builder and transition effects on the effects! Very cool.
Plus prototype is only 47kb compress and i think around 30kb gzipped. Not the smallest, I know, but a lot smaller than people think, and is totally worth the extra 15kb.
Last edited by rhinodog8; 11-13-2008 at 03:31 AM..