atw: One more try: How to include another file in an HTML page?

----- Forwarded by Hedley Finger/AU/MYOB on 08/09/2005 04:09 PM  -----
<<I have no idea what all that hex was about; I pasted an example of
reusing content from OpenOffice into Lotus Notes and that was what came
out.  Let's try that again, again.  Oh, Howard and I must have been
thinking alike.  -- Hedley>>


Elisabeth and Peter gave me enough clues (and my trusty JavaScript tome
also helped), so that I was able to concoct one way of doing it:

For example, if a fragment.js file contained this reusable content
fragment,

function fragment() {
  document.write('<b>But this is included from the external fragment.js
file.</b>');
  }

then the following code would include the reusable content in the
topic.html file,

...
<head>
   ...
   <script language="javascript" src="fragment.js">
       <!-- Imports the reusable content -->
    </script>
   ...
</head>
<body>
...
   <p>This is a paragraph internal to the topic file. <script
language="JavaScript">fragment();</script></p>
...
</body>
...

and the entire  element would display in a browser like this:

      This is a paragraph internal to the topic file. But this is included
from the external fragment.js file.

Of course, it's nowhere near as elegant as FrameMaker text insets or DITA
XML conrefs.

Regards,
Hedley

--
Hedley Finger
Technical Communications Tools & Processes Specialist
MYOB Australia <http://myob.com/au>
P.O. box 371   Blackburn VIC 3130   Australia
12 Wesley Court   Tally Ho Business Park   East Burwood VIC 3151
Australia
<mailto:hedleyDOTfingerATmyobDOTcom>
Tel. +61 3 9222 9992 x 7421,   Mob. (cell) +61 412 461 558

© MYOB Technology Pty Ltd 2005

**************************************************
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: