MCPcopy Create free account
hub / github.com/unconed/TermKit / loadScript

Function loadScript

HTML/external/syntaxhighlighter_3.0.83/src/shAutoloader.js:92–117  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

90 }
91
92 function loadScript(url)
93 {
94 var script = document.createElement('script'),
95 done = false
96 ;
97
98 script.src = url;
99 script.type = 'text/javascript';
100 script.language = 'javascript';
101 script.onload = script.onreadystatechange = function()
102 {
103 if (!done && (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'))
104 {
105 done = true;
106 scripts[url] = true;
107 checkAll();
108
109 // Handle memory leak in IE
110 script.onload = script.onreadystatechange = null;
111 script.parentNode.removeChild(script);
112 }
113 };
114
115 // sync way of adding script tags to the page
116 document.body.appendChild(script);
117 };
118
119 function checkAll()
120 {

Callers 1

shAutoloader.jsFile · 0.70

Calls 1

checkAllFunction · 0.85

Tested by

no test coverage detected