function whenReady(callback) {

		function onLoaded() {
			document.removeEventListener( "DOMContentLoaded", onLoaded, false );
			callback();
		}

		if ( document.readyState === 'complete' ) {
			callback();
		} else {
			document.addEventListener( "DOMContentLoaded", onLoaded, false );
		}
	}
/*
	 * Execute the given callback once the DOM is ready (which might already be the case).
	 */
Execute the given callback once the DOM is ready (which might already be the case).
Execute the given callback once the DOM is ready ( which might already be the case ) .
function whenReady(callback) {
		function onLoaded() {
			document.removeEventListener( "DOMContentLoaded", onLoaded, false );
			callback();
		}
		if ( document.readyState === 'complete' ) {
			callback();
		} else {
			document.addEventListener( "DOMContentLoaded", onLoaded, false );
		}
	}
function whenReady ( callback ) { function onLoaded ( ) { document . removeEventListener ( "DOMContentLoaded" , onLoaded , false ) ; callback ( ) ; } if ( document . readyState === 'complete' ) { callback ( ) ; } else { document . addEventListener ( "DOMContentLoaded" , onLoaded , false ) ; } }
Execute the given callback once the DOM is ready (which might already be the case).
Execute the given callback once the DOM is ready ( which might already be the case ) .