sdk/src/third-party/easyXDM/easyXDM.js
function whenReady(fn, scope){
    if (domIsReady) {
        fn.call(scope);
        return;
    }
    domReadyQueue.push(function(){
        fn.call(scope);
    });
}
function whenReady(fn, scope){
    if (domIsReady) {
        fn.call(scope);
        return;
    }
    domReadyQueue.push(function(){
        fn.call(scope);
    });
}
function whenReady ( fn , scope ) { if ( domIsReady ) { fn . call ( scope ) ; return ; } domReadyQueue . push ( function ( ) { fn . call ( scope ) ; } ) ; }
This will add a function to the queue of functions to be run once the DOM reaches a ready state.
If functions are added after this event then they will be executed immediately.
@param {function} fn The function to add
@param {Object} scope An optional scope for the function to be called with.
This will add a function to the queue of functions to be run once the DOM reaches a ready state . If functions are added after this event then they will be executed immediately .