28 lines
785 B
TypeScript
28 lines
785 B
TypeScript
import { executeDrawQueue } from "../outputframe-app/injects/dom-helpers";
|
|
|
|
export function createScript(value: string, appendToBody: boolean = true): HTMLScriptElement {
|
|
var script: HTMLScriptElement = document.createElement("script");
|
|
script.setAttribute("async", "");
|
|
script.innerHTML = value;
|
|
|
|
if (appendToBody) {
|
|
document.body.appendChild(script);
|
|
executeDrawQueue();
|
|
}
|
|
|
|
return script;
|
|
}
|
|
|
|
export function createHtml(value: string) {
|
|
var div: HTMLDivElement = document.createElement("div");
|
|
div.innerHTML = value;
|
|
|
|
document.body.appendChild(div);
|
|
}
|
|
|
|
export function createCss(value: string) {
|
|
var style: HTMLStyleElement = document.createElement("style");
|
|
style.innerHTML = value;
|
|
|
|
document.body.appendChild(style);
|
|
} |