jquery wait to load code example
Example 1: dom ready js
document.addEventListener("DOMContentLoaded", function() {
// code
});
Example 2: jquery ready
// jQuery document ready function
$(function() {
// do stuff
});
document.addEventListener("DOMContentLoaded", function() {
// code
});
// jQuery document ready function
$(function() {
// do stuff
});