Launch the script when the page is fully loaded

This commit is contained in:
Amauri CHAMPEAUX 2014-12-03 01:15:55 +01:00
parent a174127e8b
commit dc9980d331
1 changed files with 8 additions and 0 deletions

View File

@ -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(),