atw: Re: SEC: UNCLASS Re: How to include another file in an HTML page?

That's exactly what I *meant* to say!



-----Original Message-----
From: austechwriter-bounce@xxxxxxxxxxxxx
[mailto:austechwriter-bounce@xxxxxxxxxxxxx] On Behalf Of Silcock, Howard
DR
Sent: Thursday, 8 September 2005 3:53 PM
To: austechwriter@xxxxxxxxxxxxx
Subject: atw: SEC: UNCLASS Re: How to include another file in an HTML
page?

Hedley

You can include one file in another using IFRAMEs, as Stuart suggests.
But this seems to be regarded as unsatisfactory by many people, because
the IFRAME tag isn't so well supported and I think may cause problems
printing. Generally, including one file in another is done using Server
Side Includes (or SSIs), which involve server-side programming -
something that I can't tell you anything about.

However, if the example you describe is really all you need, you can do
it quite simply using (client-side) JavaScript. (As Elizabeth says, you
can use the 'document.write' command.)

Since you seem to want to keep the address details in one file but use
it repeatedly in different locations, I'd suggest creating a very simple
JavaScript file consisting of just these lines:

function ContactDetails() {
        document.write('MyName<br />MyStreet</span><br />MyTown<br
/>MyStateAndPostcode<br />MyTelephoneNumber')
}

but with the actual name, street etc in place of MyName, MyStreet etc.
Put these lines into an empty document and save it as text with a name
like 'contact.js', in the same folder as the HTML files in which you
want to include the details. The file contact.js is the file you'll need
to modify when your details change.

Then include these lines in the HTML documents wherever you want your
contact details to appear:

<script language="JavaScript" type="text/javascript"
src="contact.js"></script>
<p>
<script type="text/javascript">
<!--
ContactDetails()
// -->
</script>
</p>

(Strictly speaking, you only need to put the first line once in each
document. But it won't hurt if you just paste all of the above in
wherever you want your contact details to appear.)

This will put the details you want into each document, as a simple
paragraph that'll look like:
MyName
MyStreet
MyTown
MyStateAndPostcode
MyTelephoneNumber 

(but with your values substituted) using the standard font etc.
(Assuming of course that the reader has JavaScript enabled.) If you want
to make it fancier, just put in a few extra tags in your JavaScript
file, inside the string that appears between the quotes after the
document.write.

If your HTML documents aren't all in the same folder, you can't just put
your contact.js into the same folder as them, so you'll need to include
a more detailed reference for the contact.js file.

And of course you'll need to upload the contact.js file along with the
HTML source files to the web server.

Hope that helps. Feel free to contact me off-line if the explanation
isn't clear.

(Just noted that Peter Bloxsom came up with something similar!)

Howard

----------------------------------
        Howard L. Silcock
         Technical Writer
   Common Services SOE Program
Network Infrastructure Development
      Department of Defence
    Unit 3-4, 25 Napier Close
        Deakin ACT 2600          
        (02) 626 58828 
----------------------------------




**************************************************
To post a message to austechwriter, send the message to
austechwriter@xxxxxxxxxxxxxx

To subscribe to austechwriter, send a message to
austechwriter-request@xxxxxxxxxxxxx with "subscribe" in the Subject
field.

To unsubscribe, send a message to austechwriter-request@xxxxxxxxxxxxx
with "unsubscribe" in the Subject field.

To search the austechwriter archives, go to
www.freelists.org/archives/austechwriter

To contact the list administrator, send a message to
austechwriter-admins@xxxxxxxxxxxxx
**************************************************

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not to copy, disclose, or distribute this e-mail or its contents to any other 
person and any such actions are unlawful. This e-mail may contain viruses. 
Infosys has taken every reasonable precaution to minimize this risk, but is not 
liable for any damage you may sustain as a result of any virus in this e-mail. 
You should carry out your own virus checks before opening the e-mail or 
attachment. Infosys reserves the right to monitor and review the content of all 
messages sent to or from this e-mail address. Messages sent to or from this 
e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
**************************************************
To post a message to austechwriter, send the message to 
austechwriter@xxxxxxxxxxxxxx

To subscribe to austechwriter, send a message to 
austechwriter-request@xxxxxxxxxxxxx with "subscribe" in the Subject field.

To unsubscribe, send a message to austechwriter-request@xxxxxxxxxxxxx with 
"unsubscribe" in the Subject field.

To search the austechwriter archives, go to 
www.freelists.org/archives/austechwriter

To contact the list administrator, send a message to 
austechwriter-admins@xxxxxxxxxxxxx
**************************************************

Other related posts: