why place all jquery in document.ready code example Example: document ready $( document ).ready(function() { console.log( "ready!" ); });