Tuesday, November 14th, 2006

EJ: Essential JavaScript The Library

Category: JavaScript, Library

You don’t need no fancy libraries! Robert Nyman thinks that:

The web is littered with full-blown JavaScript libraries who say they will save your day and make your web development life much easier. You get encouraged to include these “mere 80 KB” libraries that is supposed to be the solution to all your needs, and practically make the web site work by itself. Needless to say, I’m not a big follower of JavaScript libraries,, especially since they almost always include lots of superfluous code, so I thought I’d put together a tiny library with only essential JavaScript functions.

The result is that he added another library to the mix: EJ – Essential JavaScript, which consists of useful JS functions:

  • $. The old favourite. No fancy arrays here though
  • getElementsByClassName
  • addClassName
  • removeClassName
  • getElementsByAttribute
  • preventDefaultBehavior
  • getStyle

Posted by Dion Almaer at 6:32 am

2.8 rating from 26 votes


Comments feed TrackBack URI

Essential? Obviously our definitions differ. A full library has indeed made my day and helped me out tremendously. I want to focus on building my app, not writing code.

Comment by Rich — November 14, 2006

The amount of code seems to be inverse proportional to the amount of phylosophy that comes with it.

Comment by Godo — November 14, 2006

Hasn’t he heard of Mootools? It’s as lightweight or robust as you want it to be, and you can get it compressed!

Comment by Andrew Herron — November 14, 2006

Not for nothing, but…absolutely none of those methods are “essential”, and what’s worse is that they really aren’t “JS”. A better name would be “DOMEssentials”, since they all deal with DOM manipulation. There’s nothing wrong with not wanting to use a library that’s already out there, but I do think that there’s something wrong with creating libraries for the sake of creating libraries. I’m with Joyce Park on this: why do web developers always want to create “the One”?
I get tired of saying it but there’s a lot more to JS than just a browser environment.

Comment by Tom Trenka — November 14, 2006

I’m Robert Nyman, author of the library. Regarding essential: it is all in the eye in the beholder. Some people want large libraries with lots of functionality and others just want the core functionality.

And as is mentioned several times by me in the comments, the name is ironic; no library can be the library that solves any problem and caters to any need.

The library in this case consists of functions that are essential in the sense that no matter the web site and interaction you’re going to use, these will be the core functions making it happen. To me, they are very useful and therefore I packaged them for anyone’s who’s interested for their convenience, that’s all. :-)

Interested in more complex libraries that does more for you? Please take a look at JavaScript frameworks – concept vs. code libraries.


“I want to focus on building my app, not writing code.”

Eh, ok. Let me humbly ask these questions then: What is building an app if you’re not writing code? Adjusting settings?


Regarding the naming: please read above and in the comments in my web site.

And yes, that is indeed a true distinction that they deal with the DOM; JavaScript is definitely more than a web browser environment, although that’s where most people will use it.

Comment by Robert Nyman — November 14, 2006

Link Listing – November 14, 2006

EJ: Essential JavaScript The Library [Via: Dion Almaer ] Apache Axis2 1.1 Released [Via: Anil John ]…

Trackback by Christopher Steen — November 14, 2006

Links (15 Oct), Web, LUA, .NET, Office 2007 Stuff

General/Web Stuff Windows Vista Ships with .NET FX 3.0 and IIS7 Built-in [Via: ScottGu ] Sun open sources

Trackback by Hulkster — November 15, 2006

Just my preference, but I like libraries that let you keep native JS syntax like YUI. I don’t even like $. This is the opinion of most of the developers on comp.lang.javascript too. I’m sure the Prototype crowd will appreciate this library though.

Comment by Bob Gulian — November 15, 2006

@Bob: “…but I like libraries that let you keep native JS syntax…”

I’m a bit confused. Most of the JavaScript libraries I’ve seen use native JS syntax. They’re not compiling some other language into JavaScript.

Which library doesn’t use native JS syntax?

Comment by Michael Geary — November 15, 2006

Leave a comment

You must be logged in to post a comment.