JS project start
This commit is contained in:
+548594
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
||||
fetch('./js/Meteorite_Landings.json')
|
||||
.then((response) => response.json())
|
||||
.then(data => {
|
||||
console.log(data);
|
||||
const tableBody = document.getElementById("meteorTableBody");
|
||||
data.forEach(meteor => {
|
||||
const row = document.createElement("tr");
|
||||
const id = document.createElement("td");
|
||||
id.textContent = meteor.id ?? "-";
|
||||
const name = document.createElement("td");
|
||||
name.textContent = meteor.name ?? "-";
|
||||
const year = document.createElement("td");
|
||||
year.textContent = meteor.year ?? "-";
|
||||
const recclass = document.createElement("td");
|
||||
recclass.textContent = meteor.recclass ?? "-";
|
||||
const mass = document.createElement("td");
|
||||
mass.textContent = meteor["mass (g)"] + "g" ?? "-";
|
||||
row.append(id, name, year, recclass, mass);
|
||||
tableBody.appendChild(row);
|
||||
})
|
||||
})
|
||||
.catch(error => console.error(error));
|
||||
@@ -0,0 +1,6 @@
|
||||
function loadMap() {
|
||||
const map = new google.maps.Map(document.getElementById("map"), {
|
||||
center: {lat: 0, lng: 0}, // Center of the globe
|
||||
zoom: 2
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user