MCPcopy Index your code
hub / github.com/CodeboxIDE/codebox / importLoad

Function importLoad

core/cb.addons/require-tools/css/css.js:68–90  ·  view source on GitHub ↗
(url, callback)

Source from the content-addressed store, hash-verified

66 head.appendChild(curStyle);
67 }
68 var importLoad = function(url, callback) {
69 createStyle();
70
71 var curSheet = curStyle.styleSheet || curStyle.sheet;
72
73 if (curSheet && curSheet.addImport) {
74 // old IE
75 curSheet.addImport(url);
76 curStyle.onload = callback;
77 }
78 else {
79 // old Firefox
80 curStyle.textContent = '@import "' + url + '";';
81
82 var loadInterval = setInterval(function() {
83 try {
84 curStyle.sheet.cssRules;
85 clearInterval(loadInterval);
86 callback();
87 } catch(e) {}
88 }, 10);
89 }
90 }
91
92 // <link> load method
93 var linkLoad = function(url, callback) {

Callers

nothing calls this directly

Calls 2

createStyleFunction · 0.85
callbackFunction · 0.50

Tested by

no test coverage detected