With your suggestions and a lot of experimentation, I have something
simple that works. Maybe I didn't do a good job originally explaining
my requirements.
Well, I may not have understood
Here's what I have. I have simplified the header and
footer here to the point you may wonder why I need them.
Not at all. If it works, use it
I think this should be safe for all browser typs, right?
Yes, I think so
I have attached some redrafts.
Hopefully they still do what you want (not what I thought you want) but
they use a bit less code
header.htm
=======
<html>
<head>
<title>header</title>
</head>
<body>
<div id="top"></div>
<p><center>
<a href="Release-History.htm">Release 2.1</a>
</center></p>
<div id="homepage"></div>
</body>
</html>
footer.htm
=======
<html>
<head>
<title>footer</title>
</head>
<body>
<div id="foot"></div>
</body>
</html>
index.htm
=======
<html>
<head>
<!-- index.htm -->
<title>Bill's Home Page</title>
<script type="text/javascript" src="external.js"></script>
</head>
<body onload="writecode()">
<!--webbot bot="Include" U-Include="header.htm" TAG="BODY" -->
<p>
<center>other stuff here.</center>
</p>
<!--webbot bot="Include" U-Include="footer.htm" TAG="BODY" -->
</body>
</html>
anotherpage.htm
===========
<html>
<head>
<!-- anotherpage.htm -->
<title>Another Page</title>
<script type="text/javascript" src="external.js"></script>
</head>
<body onload="writecode()">
<!--webbot bot="Include" U-Include="header.htm" TAG="BODY" -->
<p>
<center>other stuff here.</center>
</p>
<!--webbot bot="Include" U-Include="footer.htm" TAG="BODY" -->
</body>
</html>
This requires another file: external.js.
Add this into the same folder as index.htm
external.js
=======
function writecode() {
document.getElementById("top").innerHTML =
'<center><h1><a name="top">' + document.title + '</h1></a></center>'
document.getElementById("foot").innerHTML =
'<center><a href="#top">End of ' + document.title + '. Back to
top.</a></center>'
var HTML = '<center><a href="index.htm">'
HTML += (document.title == "Bill's Home Page") ? 'This is ' : 'Back to '
document.getElementById("homepage").innerHTML
= HTML
+ 'Bill\'s Home Page.</a>'
+ '</center>'
}
BTW, this simplifies footer.htm so much that you could replace
<!--webbot bot="Include" U-Include="footer.htm" TAG="BODY" -->
by
<div id="foot"></div>
This line is all that is included anyway
So I guess I am agreeing in part with your comment:
"I have simplified the header and footer here to the point you may wonder
why I need them."
I have simplified header.htm quite a lot also. With a bit more work, I
could put all the code into the JS function and you could similarly
replace
<!--webbot bot="Include" U-Include="header.htm" TAG="BODY" -->
by
<div id="top"></div>
(Not as the function stands, but it doesn't need much)
Well, that was all great fun.
I hope it helps
--
Cheers,
Trevor L.
[ Microsoft MVP - FrontPage ]
MVPS Website:
http://trevorl.mvps.org/