Created
February 18, 2022 13:45
-
-
Save procarrera/f1bf2161152f3b222f03e89b9e526071 to your computer and use it in GitHub Desktop.
fetch and render sections from Shopify
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
async function renderSections(sectionsIDs: Array, targetElement){ | |
const response = await fetch("/?sections=" + sectionsIDs.toString()) | |
const sections = await response.json() | |
targetElement.innerHTML = "" | |
for(const section in sections){ | |
targetElement.innerHTML += sections[section] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment