jj
    Preparing search index...

    Function createLinkPre

    • Creates a <link> element for prefetching or preloading resources.

      Parameters

      • href: string | URL

        The URL of the resource.

      • rel: "prefetch" | "preload"

        The relationship of the linked resource ('prefetch' or 'preload').

      • Optionalas: "script" | "style" | "fetch"

        The type of content being loaded ('fetch' for HTML, 'style' for CSS, or 'script' for JavaScript files). If it's not provided or set to a falsy value, it runs heuristics to find the best match from the href parameter.

      Returns JJHE

      The JJHE instance representing the link element. The <link> is accessible via .ref

      This function validates the input arguments and returns a wrapped JJHE instance. It does not append the element to the document.

      If href is not a string or URL.

      If rel or as are not valid values.