Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 15 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | // includeScript = function (src) { |
||
17 | var includeScript = function(url, target, success, error){ |
||
18 | //url is URL of external file, success is the code |
||
19 | //to be called from the file, location is the location to |
||
20 | //insert the <script> element |
||
21 | |||
22 | var scriptTag = document.createElement('script'); |
||
23 | scriptTag.src = url; |
||
24 | scriptTag.type = 'text/javascript'; |
||
25 | |||
26 | scriptTag.onerror = error; |
||
27 | scriptTag.onload = success; |
||
28 | scriptTag.onreadystatechange = success; |
||
29 | |||
30 | target.appendChild(scriptTag); |
||
31 | }; |
||
32 |