doc.ready code example
Example 1: document ready without jquery
document.addEventListener("DOMContentLoaded", function(event) {
//we ready baby
});
Example 2: jquery ready
// jQuery document ready function
$(function() {
// do stuff
});
document.addEventListener("DOMContentLoaded", function(event) {
//we ready baby
});
// jQuery document ready function
$(function() {
// do stuff
});