diff options
| author | Alex Jordan <alex@strugee.net> | 2017-01-16 14:19:29 -0500 |
|---|---|---|
| committer | Alex Jordan <alex@strugee.net> | 2017-01-16 14:19:29 -0500 |
| commit | d25f1319556a49baea90a89c147489a791372085 (patch) | |
| tree | dce97b33cbc11d478afa4c322fd7d98c612bd366 | |
| parent | b6a2e4f42e6267d015e07f22e882644827e0a15b (diff) | |
| download | php-xmpp-invitation-d25f1319556a49baea90a89c147489a791372085.tar.gz | |
Get rid of onload= in the HTML
| -rw-r--r-- | index.html | 2 | ||||
| -rw-r--r-- | scripts/main.js | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/index.html b/index.html index a3f20cc..9760c94 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> -<body onload="load_done();"> +<body> <div class="main"> <noscript><h3>You need JavaScript to follow the invitation.</h3></noscript> <h3 class="text-center" id="heading"></h3> 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(); + } + }; })(); |
