From f4ba31bddad5288a805b2e278f96d4afa7435f9f Mon Sep 17 00:00:00 2001 From: Peter Hajas Date: Sat, 7 May 2022 14:57:27 -0600 Subject: [PATCH] Add loading function for grabbing data --- script.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/script.js b/script.js index 071243f..270f6fb 100644 --- a/script.js +++ b/script.js @@ -29,3 +29,16 @@ function animate() { animate(); +async function doLoad() { + let request = new Request('data.json'); + fetch(request) + .then(response => { + return response.json() + }) + .then(json => { + console.log(json) + }) +} + +doLoad(); +