2021-01-11 22:23:08 +01:00
|
|
|
loadJSON("extensions/index.json");
|
|
|
|
function loadJSON(file){
|
2021-01-11 22:33:16 +01:00
|
|
|
fetch(file)
|
|
|
|
.then(function (response) {
|
|
|
|
return response.json();
|
|
|
|
})
|
|
|
|
.then(function (data) {
|
|
|
|
appendData(data);
|
|
|
|
})
|
|
|
|
.catch(function (err) {
|
|
|
|
console.log('error: ' + err);
|
|
|
|
});
|
2021-01-11 22:23:08 +01:00
|
|
|
}
|
|
|
|
function appendData(data) {
|
2021-01-11 22:33:16 +01:00
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
|
var mainContainer = document.getElementById(data[i].extension + "sData");
|
|
|
|
var tr = document.createElement("tr");
|
|
|
|
tr.innerHTML =
|
|
|
|
"<td id='name'>" + data[i].name + "</td>" +
|
|
|
|
"<td id='url'><a href=" + data[i].url + ">" + data[i].url + "</a></td>"
|
|
|
|
mainContainer.appendChild(tr);
|
|
|
|
}
|
2021-01-11 22:23:08 +01:00
|
|
|
}
|