Code Snippets
Login
.json fetch
Simple version of a Fetch (handy place to find it if I forget it again)
Label
function nameOfFunction() { fetch("?json") .then(function(response){ response.json().then(function(data){ doSomethingWithTheInfoRecieved(data); }); }) .catch(error => console.error('Error fetching json:', error)); }
Copy to clipboard
Copied!
©
Leerlandais 2024