UNPKG

703 BJavaScriptView Raw
1function icons(){};
2
3function load(props) {
4 var path = props && props.path;
5 var callback = props && props.callback;
6
7 var ajax = new XMLHttpRequest();
8 ajax.onload = function (e) {
9 if (ajax.status === 200) {
10 var div = document.createElement("div");
11 div.style.display = 'none';
12 div.className = 'svg-in-the-dom';
13 div.innerHTML = ajax.responseText;
14 document
15 .body
16 .insertBefore(div, document.body.childNodes[0]);
17 }
18 callback && callback(ajax);
19 }
20 ajax.open("GET", path || "https://unpkg.com/@dfds-frontend/icons/core/icons.svg", true);
21 ajax.send();
22};
23
24icons = load;
25icons.load = load;
26
27module.exports = icons;