document.load code example
Example 1: call a function on load jquery
$(document).ready(function () {
});
Example 2: document ready without jquery
document.addEventListener("DOMContentLoaded", function(event) {
});
Example 3: javascript document load
window.addEventListener("load", function(event) {
console.log("Tutte le risorse hanno terminato il caricamento!");
});
Example 4: jquery onload event
$( document ).ready(function() {
console.log( "ready!" );
});
Example 5: document. ready
$( document ).ready(function() {
console.log( "ready!" );
});
Example 6: document.addEventListener("load", function () {
window.addEventListener('load', (event) => {
console.log('page is fully loaded');
});
window.onload = (event) => {
console.log('page is fully loaded');
};