about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorAlex Jordan <alex@strugee.net>2017-01-16 14:19:29 -0500
committerAlex Jordan <alex@strugee.net>2017-01-16 14:19:29 -0500
commitd25f1319556a49baea90a89c147489a791372085 (patch)
treedce97b33cbc11d478afa4c322fd7d98c612bd366 /scripts
parentb6a2e4f42e6267d015e07f22e882644827e0a15b (diff)
downloadphp-xmpp-invitation-d25f1319556a49baea90a89c147489a791372085.tar.gz
Get rid of onload= in the HTML
Diffstat (limited to 'scripts')
-rw-r--r--scripts/main.js8
1 files changed, 8 insertions, 0 deletions
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();
+		}
+	};
 })();