JS Snippets

21 lis 2022 1 minut 43 słów

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");