diff --git a/lib/index.js b/lib/index.js index b5a8fc4..0c5aaa2 100644 --- a/lib/index.js +++ b/lib/index.js @@ -388,6 +388,7 @@ , head = oDOC.head || oDOC.getElementsByTagName("head") // loading code borrowed directly from LABjs itself + // (now removes script elem when done and nullifies its reference --sjs) setTimeout(function () { if ("item" in head) { // check if ref is still a live node list if (!head[0]) { // append_to node not yet ready @@ -403,6 +404,8 @@ return false } scriptElem.onload = scriptElem.onreadystatechange = null + scriptElem.parentNode.removeChild(scriptElem) + scriptElem = null scriptdone = true }; scriptElem.src = url