From c1dda140bcac879d7ba2f79f89403c459a56e182 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Tue, 21 Jul 2020 10:56:55 +0200 Subject: [PATCH] tweak javascript a bit --- script/single.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/single.js b/script/single.js index 5214d41..aeaf9b7 100644 --- a/script/single.js +++ b/script/single.js @@ -1,5 +1,7 @@ 'use strict'; +(function() { + function defined(x) { return x !== null && typeof x !== 'undefined'; } @@ -53,4 +55,6 @@ function setup() { } } -window.onload = setup; +window.addEventListener('load', setup); + +})();