Alternative lightweight modular javascript library
Posted by Dan Eastwell
JQuery is great, but I find I only use it to access DOM elements and manipulate them. A large part of the 19KB is unused, unless using fades and show/hides, etc. I've just come across this smaller, modular library DOMAss via 456Berea St.
I think it might be useful for doing the heavyweight DOM manipulation tasks that have taken a massive amount of code previously.
The active part of the code is this:
var str = new String(
this.value);
var remaining = maxKeys - str.length;
if(remaining <= 0){
//alert('none left');
this.value = this.value.substring(0,maxKeys);
}
var endstr = remaining + textareaMaxCharsMsg;
if (remaining < 0){ endstr = textareaLimitMsg +
maxKeys + textareaLimitEnd;}
The rest is just DOM manipulation needed to stop inline event handlers.
DOMAss seems to allow you to only include the functions you're using. Having said that, I wonder how you'd add visual effects without including all of JQuery..?
