33 lines
No EOL
890 B
JavaScript
33 lines
No EOL
890 B
JavaScript
function remplirMagasin(){
|
|
|
|
|
|
const table= document.getElementById("table_magasin_body")
|
|
|
|
|
|
fetch("../bdd/arbre.json").then((data)=>{
|
|
data.json().then((data)=>{
|
|
console.log(data)
|
|
let tech = data["technologies"]
|
|
|
|
Object.keys(tech).forEach(key => {
|
|
el = tech[key]
|
|
const tr = document.createElement("tr")
|
|
const nom = document.createElement("td")
|
|
nom.innerText = el.nom
|
|
const boost = document.createElement("td")
|
|
boost.innerText = el.boost
|
|
const cout = document.createElement("td")
|
|
cout.innerText = el.cout
|
|
|
|
tr.appendChild(nom)
|
|
tr.appendChild(boost)
|
|
tr.appendChild(cout)
|
|
table.appendChild(tr)
|
|
});
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} |