mirror of
https://github.com/samsonjs/gitter.git
synced 2026-04-27 15:07:41 +00:00
remove script elements used for JSONP calls
This commit is contained in:
parent
d997c74d70
commit
274b6e4802
1 changed files with 3 additions and 0 deletions
|
|
@ -388,6 +388,7 @@
|
||||||
, head = oDOC.head || oDOC.getElementsByTagName("head")
|
, head = oDOC.head || oDOC.getElementsByTagName("head")
|
||||||
|
|
||||||
// loading code borrowed directly from LABjs itself
|
// loading code borrowed directly from LABjs itself
|
||||||
|
// (now removes script elem when done and nullifies its reference --sjs)
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if ("item" in head) { // check if ref is still a live node list
|
if ("item" in head) { // check if ref is still a live node list
|
||||||
if (!head[0]) { // append_to node not yet ready
|
if (!head[0]) { // append_to node not yet ready
|
||||||
|
|
@ -403,6 +404,8 @@
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
scriptElem.onload = scriptElem.onreadystatechange = null
|
scriptElem.onload = scriptElem.onreadystatechange = null
|
||||||
|
scriptElem.parentNode.removeChild(scriptElem)
|
||||||
|
scriptElem = null
|
||||||
scriptdone = true
|
scriptdone = true
|
||||||
};
|
};
|
||||||
scriptElem.src = url
|
scriptElem.src = url
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue