From 3ca8eb774365d200d7272cda7c011ed0975b4fb9 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 4 Mar 2015 21:13:35 +0100 Subject: [PATCH] IE hack IE 8 and lower does not innerHTML script if a 'visible' element is not present before. Thanks https://allofetechnical.wordpress.com/2010/05/21/ies-innerhtml-method-with-script-and-style-tags/ --- tarteaucitron.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tarteaucitron.js b/tarteaucitron.js index 9cd1c5b..b7522da 100644 --- a/tarteaucitron.js +++ b/tarteaucitron.js @@ -707,7 +707,7 @@ var tarteaucitron = { } tarteaucitron.makeAsync.antiGhost += 1; tarteaucitron.addScript(url, '', function () { - document.getElementById(id).innerHTML += tarteaucitron.makeAsync.buffer; + document.getElementById(id).innerHTML += " " + tarteaucitron.makeAsync.buffer; tarteaucitron.makeAsync.buffer = ''; tarteaucitron.makeAsync.execJS(id); }); @@ -725,7 +725,7 @@ var tarteaucitron = { if (type === '') { type = (scripts[i].getAttribute('language') !== null) ? scripts[i].getAttribute('language') : ''; } - if (scripts[i].getAttribute('src') !== null) { + if (scripts[i].getAttribute('src') !== null && scripts[i].getAttribute('src') !== '') { childId = id + Math.floor(Math.random() * 99999999999); document.getElementById(id).innerHTML += '
'; tarteaucitron.makeAsync.getAndParse(scripts[i].getAttribute('src'), childId);