scrivito
Version:
Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.
29 lines (22 loc) • 611 B
text/typescript
// @rewire
export function loadCss(
url: string,
targetDocument: Document = window.document
): void {
const link = targetDocument.createElement('link');
link.rel = 'stylesheet';
link.href = url;
appendChild(targetDocument.head!, link);
}
export function loadJs(
url: string,
targetDocument: Document = window.document
): void {
const script = targetDocument.createElement('script');
script.src = url;
appendChild(targetDocument.head!, script);
}
// For test purpose only
export function appendChild(head: HTMLHeadElement, element: HTMLElement): void {
head.appendChild(element);
}