Argh. I think you're missing something here. What it sounds like is that you have a whole HTML page, scripts and all, in leftnav.htm:
Code:
<html>
<head>
<script type="text/javascript">
// The "head" bit of the script
</script>
</head>
<body>
<script type="text/javascript">
// The "body" bit of the script
</script>
</body>
</html>
And then you have another whole page in index.html (and all the other pages):
Code:
<html>
<head>
</head>
<body>
<!-- Include leftnav.htm here -->
</body>
</html>
This won't work, because it means that the eventual output of index.html is:
Code:
<html>
<head>
</head>
<body>
<html>
<head>
<script type="text/javascript">
// The "head" bit of the script
</script>
</head>
<body>
<script type="text/javascript">
// The "body" bit of the script
</script>
</body>
</html>
</body>
</html>
... which is very invalid HTML, but, more importantly, means that the "head" bit of the script isn't in the "real" (first) head. Instead, you need to have two includes:
Code:
<!-- leftnav-head.html -->
<script type="text/javascript">
// The "head" bit of the script
</script>
Code:
<!-- leftnav-body.html -->
<script type="text/javascript">
// The "body" bit of the script
</script>
... and include them both in the correct positions in index.html:
Code:
<html>
<head>
<!-- Include leftnav-head.html here -->
</head>
<body>
<!-- Include leftnav-body.html here -->
</body>
</html>
Bookmarks