u JS .ready( fn ) - specify a function to execute when the DOM is fully loaded.
$.ready(function() { alert("DOM is ready") })