I have a html page (product page) which now I have to fill with content from a .json file (array with different products, accessible via id). In the url you should be able to set a GET parameter like this:
/product?product_id=14
I know that no more information will be passed in the url, so I don't need to use any regex.
Now I simply have no idea to get the content into my html file, all I know so far is (js file):
let h1 = document.querySelector('h1');
if (h1) {
h1.textContent = '#1';
} else {
console.log('#1: No content found!');
}
So now I need to know which id was passed via GET parameter and how to load the content from the .json database.
Thanks in advance