diff --git a/exercise friend/helper.html b/exercise friend/helper.html index 1b9e0cd..8557431 100644 --- a/exercise friend/helper.html +++ b/exercise friend/helper.html @@ -29,10 +29,11 @@ return { stretch, switch: switchVal, time, reps: parseInt(reps), group }; }); console.log(items); + createElements(items); }) .catch(error => console.error('Error fetching the data:', error)); - function createElements() { + function createElements(data) { const stretchList = document.getElementById('stretchList'); data.forEach(item => { @@ -89,8 +90,6 @@ xhr.send(data); } - - window.onload = createElements;