Fix addEventListener call
authorLuciano Montanaro <mikelima@cirulla.net>
Sat, 2 Jul 2011 08:01:33 +0000 (10:01 +0200)
committerLuciano Montanaro <mikelima@cirulla.net>
Sat, 2 Jul 2011 08:01:33 +0000 (10:01 +0200)
addEventListener requires three parameters, even if konqueror/chromium
work with only two :(
And it does not work on many versions of explorer, I am told

www/screenshot-generator.js

index e647660..78c6582 100644 (file)
@@ -31,4 +31,8 @@ function build_screenshot_list()
                generate_div(screenshots[key], key, screenshots);
 }
 
-window.addEventListener('load', build_screenshot_list);
+if (window.addEventListener) {
+       window.addEventListener('load', build_screenshot_list, false);
+} else if (window.attachEvent) {
+       window.attachEvent('onload', build_screenshot_list);
+}