I am trying to find a way to store my top navigation menu in an external file for my static HTML website. I want to be able to easily update the menu and see those changes reflected on all pages without needing to upload them to a server. It's important that I can view the web pages locally as well, without relying on additional software installations.
I have come across solutions using PHP, SSI, and frames to address this issue, but none of them seem to fit my specific requirements. Frames are outdated and not ideal for SEO purposes, while PHP and SSI only work once the site is uploaded to a server.
- Frames are out of the discussion due to their impact on SEO and obsolescence with HTML5.
- PHP and SSI won't function locally and can only be used after uploading the site to a server.
After exploring various options, I believe storing the entire menu in an external JS file could be a viable solution. However, most existing examples still include some parts of the menu within the HTML file. Is it possible to have all menu items stored in a JS file and simply call that file in my HTML without including the actual menu items directly in the HTML?
I have basic knowledge of JavaScript and believe I can make necessary adjustments to a generic example to suit my needs.