Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/module.js>importScript

A JavaScript extension package for building strong and modern applications.
Latest
function importScript
import { importScript } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/module.js";

Imports a script from the given URL to the current document, useful for loading 3rd-party libraries dynamically in the browser.

NOTE: This function is only available in the browser.

Examples

Example 1

import { importScript } from "@ayonli/jsext/module";

await importScript("https://code.jquery.com/jquery-3.7.1.min.js");

console.assert(typeof jQuery === "function");
console.assert($ === jQuery);

Parameters

url
optional
options = [UNSUPPORTED]