document.ready inside a function code example
Example: jquery doc ready
// A jQuery( document ).ready() block.
jQuery( document ).ready(function() {
console.log( "ready!" );
});
// A jQuery( document ).ready() block.
jQuery( document ).ready(function() {
console.log( "ready!" );
});