javascript Wait Function
Kolink recently gave me this:

    // start the page with:
    loadScripts = [];
    loadScript = function(cb) {loadScripts.push(cb);}

    // end the page with:
    while( x = loadScripts.shift()) x();

But where do I put the code that I want to be completed when the page is loaded?
javascript Wait Function
===

Kolink recently gave me this:

    // start the page with:
    loadScripts = [];
    loadScript = function(cb) {loadScripts.push(cb);}

    // end the page with:
    while( x = loadScripts.shift()) x();

But where do I put the code that I want to be completed when the page is loaded?