This commit is contained in:
richonguzman
2023-09-03 09:11:55 -03:00
parent 6c1a8d155f
commit 05adacd907
2 changed files with 21 additions and 2 deletions
+20 -1
View File
@@ -12,5 +12,24 @@ fetch('igate_conf.json')
// Display JSON data in the HTML
function displayJSONData(data) {
const jsonContainer = document.getElementById('json-container');
jsonContainer.innerHTML = JSON.stringify(data, null, 2);
var jsonData = jsonContainer.textContent;
// Parse the JSON data into a JavaScript object
try {
var parsedData = JSON.parse(jsonData);
// Access the data in the JavaScript object
var callsign = parsedData.callsign;
//var age = parsedData.stationMode;
//var city = parsedData.city;
// Display the parsed data
console.log("Callsign : " + callsign);
//console.log("Age: " + age);
//console.log("City: " + city);
} catch (error) {
console.error("Error parsing JSON: " + error.message);
}
// jsonContainer.innerHTML = JSON.stringify(data, null, 2);
}