fetch fix?

This commit is contained in:
ed barz 2022-05-15 00:31:51 +02:00
parent 3852122e55
commit 4fe668fccb
2 changed files with 3 additions and 16 deletions

Binary file not shown.

View File

@ -44,24 +44,11 @@ Vue.component('Accordeon', {
const jsonurl = "https://ed.brz9.dev/proj/map/asset/json/db.json" const jsonurl = "https://ed.brz9.dev/proj/map/asset/json/db.json"
async function getJson(url) { var jdb
let obj = await fetch(url)
let txt = await obj.text()
let json = JSON.parse(txt)
return json
}
let db2 = getJson(jsonurl)
fetch(jsonurl) fetch(jsonurl)
.then(result => result.json()) .then(res => res.json())
.then((output) => { .then(data => jdb = data)
let jdb = output;
}).catch(err => console.error(err));
let vm = new Vue({ let vm = new Vue({
el: '#root', el: '#root',