edit: html tout propre et début css
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
async function importOuverture(){
|
||||
const res = await fetch("/status/index.html")
|
||||
if(!res.ok){
|
||||
throw new Error(`Server responded with status ${res.status} ${res.statusText}`)
|
||||
}
|
||||
let html_text = await res.text()
|
||||
let html = new DOMParser().parseFromString(html_text, "text/html");
|
||||
|
||||
for(let style of html.querySelectorAll("head > style")) {
|
||||
document.head.append(style)
|
||||
}
|
||||
|
||||
let textStatus = html.querySelector("#statusText").textContent;
|
||||
let statusBox = document.querySelector('#statusText');
|
||||
statusBox.textContent = textStatus;
|
||||
}
|
||||
|
||||
importOuverture()
|
||||
Reference in New Issue
Block a user