• 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>
    

    The loaded icon can be further styled by CSS, e.g.

    fill: red;
    

    Parameters

    • iconName: string

      Name of the icon to load, without extension, e.g. 'close'.

    • Optional callback: Callback<string>

      Function to call, when icon content is loaded.

    Returns any

    SVG code. Use innerHTML to create the icon.

    Method

    loadIcon