javascript document load

JavaScript
document.addEventListener("DOMContentLoaded", function() {
  // code
});window.addEventListener("load", function(event) {
    console.log("Tutte le risorse hanno terminato il caricamento!");
});
window.onload = function() {
  // Code here
}//use
window.onload=()=>{};function load(argument) {
	// body...
}
window.onload = load;
Source

Also in JavaScript: