31 lines
797 B
JavaScript
31 lines
797 B
JavaScript
(() => {
|
|
const server = new jServer();
|
|
|
|
const core = document.getElementById("core");
|
|
const lib = document.getElementById("lib");
|
|
|
|
server.isolate(core);
|
|
server.isolate(lib);
|
|
|
|
(async () => {
|
|
const text = "Hello, world! Please wait 5 seconds";
|
|
const script = "alert('Hello, world!');";
|
|
|
|
const url = String("./main_page.html");
|
|
|
|
const response = await fetch(url);
|
|
|
|
if (response.ok) {
|
|
const html = await response.text();
|
|
|
|
const elem = await server.index({
|
|
'text' : text,
|
|
'script' : script
|
|
}).element(html);
|
|
|
|
setTimeout(() => elem.text = "Welcome", 5000);
|
|
} else {
|
|
alert("Ошибка HTTP: " + response.status);
|
|
}
|
|
})();
|
|
})(); |