Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include one page in another page 1

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
0
0
US
With ASP I can use "Include" keyword to use some codes in another ASP file.

Can I do the same thing with HTML? If this is possible, how can I do it? I can not find <Include> tag in HTML 4.

Thanks in advance.

Seaport
 
are you looking to include javascript, stylesheets or more HTML? (it's slightly different answers for each). Klae

You're only as good as your last answer!
 
Klae,

I want to include HTML codes.

What I am trying to do is to put a bunch of navigation button, as well as my company logo, into one file, then to &quot;Include&quot; this file in every web page of the web site. Therefore, If I need to change a navigation button, I do not have to go through all web pages.

Thanks

Seaport
 
<!--#include file=&quot;HTMLFile.txt&quot; -->
- called asp include but is actually SSI.
Allows you to include the contents of the file in your page - though will only work with a &quot;server processed&quot; page, like an asp,shtm,cfm,jsp. Will write all contents to page (including JavaScript ofcourse...), like document.write() really.


b[sup]2[/sup] - benbiddington@surf4nix.com
 
Bangers,

Thanks.

Your codes look like ASP, although I do not know much about it.

My web server is an Unix. So I donot think the code works.

HTML and Javascript is the only two languages that I can use now to solve this problem.

Any other advices?

By the way, what is SSI?

Seaport

 
Really? UNIX - bummer. Well, hmmm, I guess if you want to only use JavaScript, then you will need to either document.write() them, or insert using innerHTML. So you could write an external js file which has all the writing stuff, then embed it in the pages - much like an include call - only you have to enclode everything in quotes.

<body>
...
<script src=&quot;URLForcode.js&quot;></script>
...
</body>

This means you can change the contents of this piece - by altering the code in URLForcode.js. By the way, the only difference here is that SSI include interprets a pure text file for you , as HTML.
b[sup]2[/sup] - benbiddington@surf4nix.com
 
SSI stands for Server-Side Include(s) Klae

You're only as good as your last answer!
 
The #include statement will work on *nix systems, IF SSI is turned on in the server software (that can be a big if). Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Also, your page has to be called *.shtml, or the server will not parse it as SSI. Dean Owen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top