Sunday, January 14th, 2007

JavaScript Scripting Essentials

Category: JavaScript, Library, Programming

Dan Webb asks what are your JavaScript essentials? Those bits and pieces you can’t live without that get copy/pasted from project to project. His pragmatic list includes the $ function, getElementsByClassName, Dean’s event handling, the JS 1.6 array methods, and the DOMContentLoaded event. His full script that he guarantees he _won’t_ support is here.

Do you start with a full on framework or library no matter what the project size, or do you have a small script you use similiar to Dan’s? Do you go with a clean slate until you really feel pain, or do you just swear off javascript and start with GWT or a drag and drop IDE?

Posted by Rob Sanheim at 4:47 pm

3.9 rating from 33 votes


Comments feed TrackBack URI

It’s definitely a very small world…

Comment by Felix PleÅŸoianu — January 15, 2007

I use Moo Tools :)

Comment by Ricardo Momm — January 15, 2007

I normally use prototype. Sometimes with for some effects!

Comment by Georges — January 15, 2007

[quote]I normally use prototype. Sometimes with for some effects![/quote]

too bad that this fat libshit only works in firefox…that fucks up every 10 minutes since the last update. it’s a shame!

Comment by handcoder — January 15, 2007

I use MooToools. It’s the best tool for me.

Comment by Nir Tayeb — January 15, 2007

@handcoder – looks like somone has a case of the Mondays! I use Prototype as well and some bits n peaces that I have put togeather to compliment it.

Comment by Mario — January 15, 2007

I’m a bit of a “notbuilthere” person. Been building my library since before the names “Prototype” and “Dojo” were known, so it’s not so easy to port my work to use either of those.

My own portables include the standards such as addEvent(), X() and $(), and a load of generally useful functions such as date_m2h(d) (translates MySQL dates to Human-readable), isArray(obj), newNumberRange(from,to,pad) (returns an array of numbers, optionally padded (03,04,05, etc)).

There are about 3 dozen functions I bring around project to project. Those are probably the more interesting ones.

Comment by Kae Verens — January 15, 2007

On large projects I use prototype + my personal library.
For one-off pages or tiny projects I just write pure naked Javascript.
Mootools is starting to look pretty slick. I might end up using that with some of the new stuff I’ll be doing soon.
I might have to steal the new scriptaculous morph function though (Tobie Langel is a genius).

Comment by Thomas Aylott — January 15, 2007

Thomas… wow wow wow! I only contributed the part that makes the morph accept a class name…! I really doubt that makes me into a genius! ;-)

Comment by Tobie Langel — January 16, 2007

Prototype ia a MUST! Plus I always inject some additional functions like startsWith(), trim(), normalizeSpaces(),.. for Strings .
And recently I have developed simple JS function createAndSubmitDynamicForm(href) that allow me to use <A HREF – like JSP tags that actually produce HTTP POST :
Plus sometimes I use Behaviour. Surprisingly enough Sriptaculous is usedonly for unit testing..

Comment by Robert — January 17, 2007

Prototype?! Isn’t that about 50+kB large? Plus for all the fun stuff you’d need scriptaculous too, right? Thanks, but I’ll pass. Most of the time I use plain old JS scripts and whenever I want some bells and whistles I use jQuery.

Comment by Tom Sieron — January 27, 2007

Leave a comment

You must be logged in to post a comment.