/    Sign up×
Community /Pin to ProfileBookmark

Calling a text file in html

I am trying to go without creating frames to display my navigation bar so I want to create a text file that has the html code in it. Is there a way to call a text file within your html so I can pull just the navigation code out of my existing html? It would make it much easier to edit rather than searching for it within the rest of the html. Right now the navigation bar code is embedded in each of my html pages and I have to edit each one separately. Very tedious.

to post a comment
HTML

5 Comments(s)

Copy linkTweet thisAlerts:
@ccoderMay 10.2005 — Something like a server side include? <!-- #INCLUDE virtual="/_includes/footer_nav.htm" -->
Copy linkTweet thisAlerts:
@jeremybraunauthorMay 10.2005 — Can I just include that in my html? I just tried it with this call...

<!-- #INCLUDE file="testing.txt" -->

The text file had some html code that I wanted the html page to call. It didn't work. Am I going about this wrong?
Copy linkTweet thisAlerts:
@felgallMay 10.2005 — You need to specify it like this: <!-- #INCLUDE virtual="/_includes/footer_nav.htm" -->

Also you need to name the file containing it with .SHTML as the file type unless you override one of the other file types to be recognised as allowing server side includes.
Copy linkTweet thisAlerts:
@jeremybraunauthorMay 10.2005 — How does this look...

<!-- #INCLUDE virtual="/_includes/testing.htm" -->

I saved testing in a folder "_includes" as testing.shtml. I don't have a virtual directory called "_includes" so I created one. I'm guessing that's not right. What am I doing wrong?
Copy linkTweet thisAlerts:
@jeremybraunauthorMay 10.2005 — I checked and I have SSI enabled on my web server but I can't get this to work. I've created a web page, inserted <!-- #INCLUDE file="testing.htm" --> into the body of my page that I would like to call the file. I saved that file as an SHTML file and nothing happens.

This is the file that I saved that I am attempting to call...

<html><head></head><body>

<p align="left"> <b> <font color="#FFFFFF">

<font size="2"><a href="index.htm"><img border="0" src="images/1home.gif" align="bottom" width="65" height="24" ></a>

<a href="training.htm" onMouseover="dropdownmenu(this, event, menu5, '185px')" onMouseout="delayhidemenu()" href="../commercial.htm">

<img border="0" src="images/1training.gif" align="bottom" width="83" height="25" ></a></font>

<a href="hr.htm" onMouseover="dropdownmenu(this, event, menu1, '152px')" onMouseout="delayhidemenu()" href="hr.htm"><img border="0" src="images/1hr.gif" align="bottom" width="46" height="25" ></a> </font></a><font size="2">

<a href="marketing.htm">

<img border="0" src="images/1marketing.gif" align="bottom" width="101" height="25" ></a></font>

<a href="bankers.htm" onMouseover="dropdownmenu(this, event, menu2, '185px')" onMouseout="delayhidemenu()" href="commercial.htm">

<img border="0" src="images/1bankers.gif" align="bottom" width="84" height="25" ></a></font>

<a href="operations.htm" onMouseover="dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()" href="operations.htm"><img border="0" src="images/1operations.gif" align="bottom" width="101" height="24" ></a></td>

</body></html>
×

Success!

Help @jeremybraun spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...