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