Hello, All. First Post.
Is there a downside to replacing most non-content portions of HTML pages with Javascript?
When I can fit it in, I'm a part-time Webmaster for our organization's site. I am weary of uploading hundreds of pages when I want to change something on the headers or footers.
I have about 3,000 pages of static archives, and 30 or 40 pages that are updated regularly. I'd like to be able to change the header and footer of the whole site once in a while without having to upload every page again.
I've used a lot of CSS to style everything (easy to update), but it is the text and links of the headers and footers that I'd like to replace entirely with Javascript.
Would it be too weird to do something like this?
I'm not looking for an examination of my code just yet, just opinions on whether or not it would be a problem to use "document.write ..." for so much.
<html>
<head>
<link rel="stylesheet" type="text/css" href="../style/styles.css" />
</head>
<body>
<!-- banner here -->
<script type="text/javascript" src="../scripts/banner.js"></script>
<!-- a list of links to current content here -->
<script type="text/javascript" src="../scripts/current_links.js"></script>
<!-- content here -->
<p>A couple of thousand words of content would be here, nice and tidy.</p>
<!-- footer here -->
<script type="text/javascript" src="../scripts/footer.js"></script>
</body>
</html>
The files "banner.js", "current_links.js" and "footer.js" would be something along these lines:
document.write(' <div id="banner"> MyWebSite Info <a href="../new.htm">NEW STUFF</a> | <a href="../old.htm">OLD STUFF</a> etc., etc. </div> ')
The test that I've done loads like a rocket, is super easy to update, and the code is squeaky clean. It seems TOO easy. What's wrong with the plan?
Thanks for your input.
Reb