I am posting this thread to encourage those who have not used Ajax before. It is much easier than I thought it would be.
I have many lines at the begining and the end of all my pages that are constant. The obvious solution is to use a Server-Side Include for these. However, the VLE I am using (WebCT Vista) will not permit these.
Hitherto, I have either used loading a javascript file which writes the appropriate HTML (for the top lines), and a set of lines in the Dreamweaver Template (for the bottom lines).
Having read the article on 'How do I include one HTML file in another' at
Boutell.com, I though that Ajax would do it better, and indeed it has.
Boutell provides the javascript function clientSideInclude. All I needed to do was:
- Include this function in my preliminary javasacript file;
- Add two calls to this function in my onload function;
- Insert two named DIVs, one at the top and one at the bottom.
It worked like a dream.
In the onload function I have the lines:
clientSideInclude('BottomLines', '../../Includes/BottomLines.htm');
clientSideInclude('TopLines', '../../Includes/TopLines.htm');
and in the file I have
<div id="TopLines"><div> at the top, and
<div id="BottomLines"><div> at the bottom.
This has the great advantage that I can edit these included files without Dreamweaver telling me I cannot change the template!
John Rostron