jquery
// jQuery document ready
$(document).ready(function() {
});
$(document).ready(function() {
console.log( "ready!" );
});
$(function(){
})
native js
document.addEventListener("DOMContentLoaded", function() {
// code
});
document.addEventListener("DOMContentLoaded", function(event) {
//we ready baby
});
window.onload = function() {
};
document.addEventListener("DOMContentLoaded", fn);