Loads a specific SVG file from 'skin/icon' folder. Handles duplicate requests and asynchronous loading. Returns the SVG code, not a live DOM element.
Doesn't need to be called directly as it's automatically used by HTML like
<div data-icon=’closeTab’></div> Copy
<div data-icon=’closeTab’></div>
The loaded icon can be further styled by CSS, e.g.
fill: red; Copy
fill: red;
Name of the icon to load, without extension, e.g. 'close'.
Optional
Function to call, when icon content is loaded.
SVG code. Use innerHTML to create the icon.
loadIcon
Loads a specific SVG file from 'skin/icon' folder. Handles duplicate requests and asynchronous loading. Returns the SVG code, not a live DOM element.
Doesn't need to be called directly as it's automatically used by HTML like
The loaded icon can be further styled by CSS, e.g.