fix x-res topic load bug
This commit is contained in:
parent
0635627950
commit
cdaeb477a2
|
@ -858,17 +858,19 @@ function mainInit(){
|
|||
.then(resp => {
|
||||
if(!resp.ok) throw(href+" failed to load");
|
||||
let xRes = resp.headers.get("x-res")
|
||||
if(xRes!=null) {
|
||||
for(let res of xRes.split(",")) {
|
||||
let pro;
|
||||
if(stripQ(getExt(res)) == "css") pro = asyncGetSheet("/s/"+res)
|
||||
if(stripQ(getExt(res))=="css") pro = asyncGetSheet("/s/"+res)
|
||||
else pro = asyncGetScript("/s/"+res)
|
||||
pro.then(() => console.log("Loaded " + res))
|
||||
pro.then(() => console.log("Loaded "+res))
|
||||
.catch(e => {
|
||||
console.log("Unable to get res '"+res+"'");
|
||||
console.log("Unable to get '"+res+"'");
|
||||
console.log("e",e);
|
||||
console.trace();
|
||||
});
|
||||
}
|
||||
}
|
||||
return resp.text();
|
||||
}).then(data => {
|
||||
document.querySelector("#back").outerHTML = data;
|
||||
|
|
Loading…
Reference in New Issue