Created
March 16, 2022 15:55
-
-
Save asathoor/4d7c5f29ab4df0e0eae284626c16ae64 to your computer and use it in GitHub Desktop.
JSON fetch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// begynt fetch() her | |
fetch("DIN-GEOJSON-FIL-HER.JS").then( | |
response => { | |
return response.json(); // get JSON data$ | |
}).then(data => { | |
console.log(data); | |
// tjek objektet i browserens udviklingsværktøj | |
}).catch(err => { | |
// Error and description | |
console.log('Error: ' + err) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment