Compare commits

..

No commits in common. "ea464e791a0ab821c6f92a2eb876d4154177aaac" and "2b72155ee2cccd70e97345a048842bd4d05feb67" have entirely different histories.

3 changed files with 5 additions and 52 deletions

View file

@ -9,15 +9,5 @@
<p>Click</p>
<script src="./js/intro.js" deref></script>
<script src="./js/element.js"></script>
<table>
<thead>
<th>nom</th>
<th>boost</th>
</thead>
<tbody id="table_technologies_body">
</tbody>
</table>
</body>
</html>

View file

@ -1,34 +1,15 @@
class Element{
class element{
constructor(techno,tag) {
this.tag = tag
this.techno = techno
}
charger_depuis_bdd(){
fetch("../bdd/arbre.json").then((data)=>{
data.json().then((data)=>{
this.props = data["technologies"][this.techno]["elements"][this.tag]
this.cout = this.props.cout
this.nom = this.props.nom
this.boost = this.props.boost
fetch("../bdd/arbre.json").then((data,r)=>{
let props = data["technologies"][this.techno][this.tag]
this.cout = props.cout
this.boost = props.boost
})
})
}
afficher_props_dans_html(){
const table= document.getElementById("table_technologies_body")
const tr = document.createElement("tr")
const nom = document.createElement("td")
nom.innerText = this.nom
const boost = document.createElement("td")
boost.innerText = this.boost
tr.appendChild(nom)
tr.appendChild(boost)
table.appendChild(tr)
}
}

View file

@ -1,18 +0,0 @@
class Technologie{
constructor(nom) {
this.nom = nom
}
charger_depuis_bdd(){
fetch("../bdd/arbre.json").then((data)=>{
data.json().then((data)=>{
console.log(data)
this.props = data[this.nom]
this.cout = this.props.cout
this.boost = this.props.boost
})
})
}
}