js file document ready code example
Example 1: dom ready js
document.addEventListener("DOMContentLoaded", function() {
// code
});
Example 2: jquery doc on ready
$(document).ready(() => {
console.log('ready');
});
document.addEventListener("DOMContentLoaded", function() {
// code
});
$(document).ready(() => {
console.log('ready');
});