pax.load

This is library can detect when the complete DOM has been rendered.  It can also load PAX scripts on the fly

Author

Mikkel Bergmann, http://www.pointful.com

Summary
pax.loadThis is library can detect when the complete DOM has been rendered.
Properties
pax.loadThis library OBJ
pax.load.docLoadedTrue if the document DOM has loaded (excluding images and sub-documents).
pax.load.docLoadedFuncsList of functions to run when the document has loaded
Functions
pax.load.scriptLoads a list of scripts, then calls the callback
pax.load.cssLoad CSS via ajax, and runs the callback when done.
pax.load.onloadedBinds a function to launch when the DOM document is ready (excluding loading images and sub-documents); launches the function immediately if document is ready.

Properties

pax.load

This library OBJ

pax.load.docLoaded

True if the document DOM has loaded (excluding images and sub-documents).

pax.load.docLoadedFuncs

List of functions to run when the document has loaded

Functions

pax.load.script

pax.load.script = function(list,
callback)

Loads a list of scripts, then calls the callback

Parameters

listlist of scripts that we want to load, this can be either the complete or relative path
callbacka function to run, when the scripts have loaded

Example

<span id="pax.script.example1">You should see a message pop up, then disappear after 5 seconds here: </span>
[:.
    function showWindowAfterLoad() {
        pax.box.showOnRight( 'myBox', 'This box is rendered via an asynchronously loaded library', 'hintMessage', $('pax.script.example1'), 5 );
    }

    pax.load.script( '/pax/pax.box.js', showWindowAfterLoad );
:]

Loads the pax.box library via ajax, and uses it to display a message box using <showBox>.

pax.load.css

pax.load.css = function(url,
callBack)

Load CSS via ajax, and runs the callback when done.

Parameters

urlThe URL of the CSS you want to load
callBackThe method to run when the CSS has been loaded

Example

[:.
    pax.load.css( '/pax/resource/pax_consolidated.css', function() { alert('Loaded CSS.'); } );
:]

Loads some CSS, and alerts when done.

pax.load.onloaded

pax.load.onloaded = function(func)

Binds a function to launch when the DOM document is ready (excluding loading images and sub-documents); launches the function immediately if document is ready.

Parameters

funcFunction that runs when the event fires

Example

var myFunc = function() {
    alert('hello world!');
}
pax.load.onloaded( myFunc );

Will alert when the DOM has loaded.  Note that the example won’t run, as the document has already loaded

pax.load.script = function(list,
callback)
Loads a list of scripts, then calls the callback
pax.load.css = function(url,
callBack)
Load CSS via ajax, and runs the callback when done.
pax.load.onloaded = function(func)
Binds a function to launch when the DOM document is ready (excluding loading images and sub-documents); launches the function immediately if document is ready.
This class creates boxes for various purposes; it’s a base class for window, and widget classes
Close