Difference between revisions of "Webhosting Server Side Includes"

From AAISP Support Site
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
(Created page with "link=:Category:Webhosting Our servers do not offer SSI facilities <!--#include virtual="ssi.htm" --> or <!--#include file="ssi.htm" --> however you can cr...")
Line 62: Line 62:

Revision as of 17:24, 25 February 2015


Our servers do not offer SSI facilities or however you can create the same effect by using Java Script, these notes were submitted by a customer and are here to help you.



Include the following in the <head></head> section of your page

<SCRIPT language="JavaScript" > </SCRIPT>


<script type="text/javascript" src="myincludefilename.js"> </SCRIPT>

with your own file name substituted where you want the included text to appear.


Create a file myincludefilename.js to hold the text you want to output, then insert the text and wrap each line in a document.write(" "); statement.

Remember that in JS any newline characters ends the instruction so every line must be wrapped in a document.write statement.

The javascript file can have any extension, and be held in any folder subject to the usual rules about valid pathnames.

Example: Good

document.write("James Brown is in the office <br>");

document.write("Helen Smith is out of office <br>");

Example: Bad

document.write("James Brown is in the office <br>

"Helen Smith is out of office <br>");

A web search on 'javascript include' will bring up lots more examples.

Other Webhosting pages:

<ncl style=bullet maxdepth=5 headings=bullet headstart=2 showcats=1 showarts=1>Category:Webhosting</ncl>

Webhosting Service page on our main website