Code
One great feature of JavaScript is the ability to create objects through shorthand (or more precisely "object literal notion") rather than writing the full syntax of a function block and using the prototype object. This ability to use shorthand is the basis of JSON, but is also useful to making code less verbose - albeit somewhat less readable.
My earlier posts jumped right in with some somewhat advanced concepts of Object Oriented programming in JavaScript - specifically through the use of prototype. In this article I'm going to take a step back and explain prototype and how it fits into JavaScript OOP programming. This really just scratches the surface, but you need to start somewhere, right?
In a previous article, JavaScript Built-in Listeners and Memory Leaks, I described one method of wrapping built-in JavaScript DOM events into a custom event handler so listeners can be properly cleaned up to prevent memory leaks. In this article I'll describe a use of removeBuiltinListener to save you a step if you're adding and removing a lot of DOM elements which have listeners attached.
Awhile back on Digg there were a couple posts about animated sliding boxes similar to what Digg uses for its comment system.
Built-in Event Listeners, JavaScript Objects, the DOM, and Memory Leaks
As I mentioned yesterday in my article about custom event listeners, I decided to tie built-in listeners into my Event object. I did this for two reasons. The secondary reason was simply because it was easier to deal with multiple methods with similar construct within the same object.