FastInit: a faster window.onload

This class implements a kind of onload function queue, based on work by the awesome Dean Edwards. This will ensure that your initialisation function(s) are called once the browser DOM is ready and not have to wait for all the images. Hopefully easing that bugbear of web interfaces: slow initialisation.

Current Version: 1.4.1 - 15 Mar 2007 - Demo / Download

Instructions

To use it you need the fastinit.js file and In your page you call FastInit.addOnLoad with a reference or 2 to your onload functions like this:

FastInit.addOnLoad(yourFunction, anotherFunction, yetAnotherFunction);

All functions are called in the order in which they were added. You can call addOnLoad as many times as you like. Functions loaded before the DOM is loaded are placed in the queue, and called in order after the 'DOM loaded' event occurs. Those loaded after the DOM is loaded are executed immediately.

It will also default to the standard handlers if the browser doesn't support either of the faster methods.

Demo & Download

Dorky demo, Download here: fastinit.js.

Change Log

Version 1.4.1

Version 1.4

Version 1.3

Version 1.2

Version 1.11

Released under an MIT-Style license, same as Prototype.

Version 1.1

Version 1.0

Random outings from a chaotic mind

The Dexagogo Rocket Australian Web Industry Association logo

Delicious

Twitter