A compact javascript helper library
Libraries like Prototype and jquery are great when you need to do lots of manipulation of an HTML page and its associated DOM/CSS, but sometimes, you just need the bare bones to get the task done.
So I put together a small tight library of javascript helpers which do the bare minimum but surprisingly are pretty powerful, I hope you find it useful. You can find the latest version here at github.
Here's what's in the library:-
- add multiple page onLoad & onUnload events
- add multiple on* event handlers to an element which are executed in the order they are added, and also the ability to unregister a specific event handler later.
- next, previous, up and down element finders for walking the DOM
- hasClass, add or remove a Class from an element, the functions preserve multiple classes associated with an element.
- getElementsByClassName, does what it say on the tin
- stripeTableRows, again does what it says on the tin
- higlightExternalLinks, which adds a class of 'external' (by default) to all links within a container (default document) which are external and dont wrap an image tag.