Ver Fonte

Launch the script when the page is fully loaded

Amauri CHAMPEAUX há 10 anos atrás
pai
commit
dc9980d331
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      tarteaucitron.js

+ 8 - 0
tarteaucitron.js

@@ -13,6 +13,14 @@ var tarteaucitron = {
     "state": [],
     "launch": [],
     "init": function (params) {
+        "use strict";
+        if (window.addEventListener) {
+            window.addEventListener("load", tarteaucitron.load(params), false);
+        } else {
+            window.attachEvent('onload', tarteaucitron.load(params));
+        }
+    },
+    "load": function (params) {
         "use strict";
         var cdn = tarteaucitron.cdn,
             language = tarteaucitron.getLanguage(),