document.addEventListener('DOMContentLoaded', function () { console.log(1) }); window.onload = function () { console.log(2) }