kopia lustrzana https://github.com/c9/core
Merge pull request +15908 from c9/require-cleanup
do not leave script nodes in the documentpull/453/merge
commit
cfedcebf6c
|
@ -407,6 +407,7 @@ var loadScriptWithTag = function(path, id, callback) {
|
||||||
|
|
||||||
s.onload = s.onreadystatechange = function(_, isAbort) {
|
s.onload = s.onreadystatechange = function(_, isAbort) {
|
||||||
if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
|
if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
|
||||||
|
s.remove && s.remove();
|
||||||
s = s.onload = s.onreadystatechange = null;
|
s = s.onload = s.onreadystatechange = null;
|
||||||
if (!isAbort)
|
if (!isAbort)
|
||||||
callback(null, id);
|
callback(null, id);
|
||||||
|
|
|
@ -146,8 +146,7 @@ define(function(require, exports, module) {
|
||||||
s.async = true;
|
s.async = true;
|
||||||
s.src = '//api.usersnap.com/load/' +
|
s.src = '//api.usersnap.com/load/' +
|
||||||
'e3d3b232-1c21-4961-b73d-fbc8dc7be1c3.js';
|
'e3d3b232-1c21-4961-b73d-fbc8dc7be1c3.js';
|
||||||
var x = document.getElementsByTagName('script')[0];
|
document.head.appendChild(s);
|
||||||
x.parentNode.insertBefore(s, x);
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
// Create UI elements
|
// Create UI elements
|
||||||
|
|
Ładowanie…
Reference in New Issue