Hey, i have recently hit a wall where I don’t know how to fetch JSON data in Shopify, I’m new on the platform but I have experience in pure javascript. The following code is working on my own website ran by my server:
fetch ('/data.json')
.then(response => response.json())
.then(substance_data => {
for (var substance in substance_data) {
_substances_datalist.innerHTML += `
But this does not work in a "section" .liquid file: {% javascript %}.
so my question is: how do I fetch JSON data I Shopify through .liquid file, and where do I put the JSON file.