Prevent looping

This commit is contained in:
Amauri CHAMPEAUX 2015-02-22 17:33:14 +01:00
parent 17a23f664d
commit 10ff24c661
1 changed files with 5 additions and 0 deletions

View File

@ -584,6 +584,7 @@ var tarteaucitron = {
document.getElementsByTagName('head')[0].appendChild(script);
},
"makeAsync": {
"antiGhost": 0,
"buffer": '',
"init": function (url, id) {
"use strict";
@ -606,6 +607,10 @@ var tarteaucitron = {
},
"getAndParse": function (url, id) {
"use strict";
if (tarteaucitron.makeAsync.antiGhost > 10) {
return;
}
tarteaucitron.makeAsync.antiGhost += 1;
tarteaucitron.addScript(url, '', function () {
document.getElementById(id).innerHTML += tarteaucitron.makeAsync.buffer;
tarteaucitron.makeAsync.buffer = '';