Loading Assets
To load an array of external JavaScript files into the current page, use the asynchronous wire.loadJs function. The function will return context to the caller when all files have been loaded successfully on the page.
1
// TypeScript
2
await wire.loadJs( ["file1.js", "file2.js"] );
3
4
// JavaScript
5
wire.loadJs( ["file1.js", "file2.js"], () => {
6
...
7
});
Copied!
To load an external CSS file into the current page, use the wire.loadCss function. The function will return context to the caller when the file has been loaded successfully on the page.
1
// TypeScript
2
await wire.loadCss("file1.css");
3
4
// JavaScript
5
wire.loadCss("file1.css", () => {
6
...
7
});
Copied!
Copy link