JS Snippets

21 Nov 2022 1 minutes 43 words

Some useful stuff for JS maneuverability.

wait until a document has been fully loaded.

window.addEventListener('DOMContentLoaded', (event) => {
    // Your JavaScript code here execute once DOM ready
});

open a console in the browser and load a script

const pagefind = await import("/_pagefind/pagefind.js");