Dom Ready JS
document.addEventListener("DOMContentLoaded", function() {
// code
});
Joyous Jaguar
document.addEventListener("DOMContentLoaded", function() {
// code
});
$(function(){
//jQuery code here
});
// A document ready block with JQery.
$( document ).ready(function() {
// we ready for fire action with JQery.
});
// A document ready block with javascript.
document.addEventListener("DOMContentLoaded", function(event) {
// we ready for fire action with javascript.
});
// Pure JS document ready ...
document.addEventListener('DOMContentLoaded', (event) => {
//the event occurred
})
document.addEventListener("DOMContentLoaded", function(event) {
//we ready baby
});
// without jQuery (doesn't work in older IEs)
document.addEventListener('DOMContentLoaded', function(){
// your code goes here
}, false);