diff --git a/contents.js b/contents.js index b787f81..9f4630e 100644 --- a/contents.js +++ b/contents.js @@ -1,11 +1,13 @@ + const reference = document.getElementById("reference"); const contributionsList = document.getElementById("contributions"); -window.addEventListener("load", () => { - fetch("https://hub.xpub.nl/soupboat/atlas-api/contributions") + + function fetchContents(){ + fetch("https://hub.xpub.nl/soupboat/atlas-api/contributions") .then((response) => response.json()) .then((data) => populateContributions(data)); -}); +} function populateContributions(contributions) { contributions.forEach((contribution) => { @@ -23,3 +25,5 @@ function createSection(contribution) { section.querySelector(".content").innerHTML = contribution.content_html; return section; } + + diff --git a/index.html b/index.html index 58e18aa..8f9d255 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,12 @@ - - + + + +