I am working on a project with destructuring assignment for Menu Items in an own js file. The 'Menu point' is loading the HTML content out of the html_content.js file into the index.html file itself. So
var html_content {
"Menu point 1": "<p>html content for menu point 1</p>",
"Menu point 2": "<p>html content for menu point 2</p>"
}
Is loaded via
gridWrapper.innerHTML = html_content[itemName];
into the HTML file. This is working fine, but now I want to load the HTML content out of a own file, something like
var html_content {
"Menu point 1": "menu1.html",
"Menu point 2": "menu2.html"
}
gridWrapper.innerHTML = <html_content[itemName]>; //load the HTML file here
I actually have no idea how to do that, my JS experience is very low.
There is another js file, I don't know if it's important for that, here's the main.js file