About
Learn more
Welcome to Yishun Boys HUb
`
function fetchData() {
const datasetId = "d_dddc19f6c90edd7cff6b57494630ad29";
const url = "https://data.gov.sg/api/action/datastore_search?resource_id=" + datasetId;
fetch(url)
.then(response => response.json())
.then(data => {
// Output the JSON data to the page
document.getElementById('output').textContent = JSON.stringify(data, null, 2);
})
.catch(error => {
console.error('Error fetching data:', error);
document.getElementById('output').textContent = 'Error fetching data';
});
}