TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
RE: Including content of one file of HTML in another?
Subject:RE: Including content of one file of HTML in another? From:"Richard Smith" <Richard -dot- Smith -at- windriver -dot- com> To:"TECHWR-L" <techwr-l -at- lists -dot- raycomm -dot- com> Date:Thu, 20 Dec 2001 10:22:39 -0800
To use JavaScript to include, all you do is this:
Step 1: Create a file and name it something sensible, like navbar.js. In
this file, all you need is the following line (although comments would be a
fine idea):
navbar = 'Put your real navbar code here.';
Step 2: In the header of each file you want the navbar to appear in, put the
line:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"
SRC="./navbar.js"></SCRIPT>
Step 3: In the body of each file you want the navbar to appear in, put this
line where the navbar code would ordinarily be:
This is simple, and there surely are other ways to do it (probably even
better ways to do it with JavaScript). The benefit here is that you only
have one location of the navbar code to edit (much like a library item) but
you can edit it with any text editor. This doesn't require any proprietary
tool, any server side functionality, any real programming skill--as
evidenced by the fact that I did it ;-)
Richard Smith
>
> >Isn't there a way to create a navigation bar and store it in one
> >file, and then have the pages of a website call it from that file
> >and stick it at the top of their content? That would make it a
> >LOT easier to modify the navbar, as you wouldn't have to tweak
> >EVERY PAGE to do it.
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Collect Royalties, Not Rejection Letters! Tell us your rejection story when you
submit your manuscript to iUniverse Nov. 6 -Dec. 15 and get five free copies of
your book. What are you waiting for? http://www.iuniverse.com/media/techwr
---
You are currently subscribed to techwr-l as: archive -at- raycomm -dot- com
To unsubscribe send a blank email to leave-techwr-l-obscured -at- lists -dot- raycomm -dot- com
Send administrative questions to ejray -at- raycomm -dot- com -dot- Visit http://www.raycomm.com/techwhirl/ for more resources and info.