document.addEventListener("DOMContentLoaded", function() { // code });
window.onload = function() { };
document.addEventListener("DOMContentLoaded", fn);