Fetches markup from a remote link and creates a document fragment out of it.
The link to load the markup from
The request init used with fetch
fetch
A promise that resolves to the document fragment.
import { loadFragment } from 'inherent';const frag1 = await loadFragment(`./my/fragment.html`)// <p>Para 1</p><p>Para 2</p> Copy
import { loadFragment } from 'inherent';const frag1 = await loadFragment(`./my/fragment.html`)// <p>Para 1</p><p>Para 2</p>
Fetches markup from a remote link and creates a document fragment out of it.