Basically, I have a few sections, a header, two sidebars, and a footer to my website with the main content in the center. I used a table for most of the formatting for this design. What I would like to do is have one HTML file for each generic section, header footer and sidebars. That way I don't have to edit every page when I need to change something on the rest of the pages.
I usually would use PHP to do this but the server I am working on does not read PHP and it seems I can't get the IT guys to install it. I have tried a JavaScript method but the JavaScript method does not seem to be working and I am not sure why. This is an example of the JavaScript I method I was trying:
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('#header').load("header.html");
$('#rsbar').load("rsbar.html");
$('#lsbar').load("lsbar.html");
$('#footer').load("footer.html");
});
</script>
</head>
<body>
<div id="header"></div>
<div id="rsbar"></div>
<div id="lsbar"></div>
<div id="footer"></div>
</body>
Where header rsbar lsbar and footer would be separate HTML files I'd want to pull the code from.
Also if I can get this method to work. If my file structure looks something more like this:
html
-->header
-->footer
-->lsbar
-->rsbar
css
js
images
pdfs
pages
and the file that I want to use to call the header HTML from using the JavaScript is in pages, for the code going back one directory and then to the HTML would the filepath work as '../html/header.html' as an example? I was having issues trying this but can't seem to find what else I'd use to move up the directory one folder...