From d25f1319556a49baea90a89c147489a791372085 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Mon, 16 Jan 2017 14:19:29 -0500 Subject: Get rid of onload= in the HTML --- scripts/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/main.js b/scripts/main.js index e47bf88..1e3b5b6 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -86,4 +86,12 @@ rehash(); window.addEventListener("hashchange", rehash, false); } + + // Wait for the DOM to be ready + document.addEventListener('DOMContentLoaded', load_done, false); + document.onreadystatechange = function() { + if (document.readyState === 'interactive') { + load_done(); + } + }; })(); -- cgit 1.4.1