Solved

To show another HTML file in a HTML file

Posted on 2000-03-28
6
184 Views
Last Modified: 2012-05-04
Hi,

I have this small HTML file, and I need to show it out in another HTML file.
Someone has told me that I can use <!-- include file="..."-->, but this line just like a comment to HTML. I have tried it, it has no effects at all.

I have also tried <IFrame name="stock" src="http://.../stockquotes.html" frameborder="no" border=0>, but it covers all my graphics files which in the same table. And it doesn't work in Netscape also.

Does anyone know how to solve this problem?

Thanks a lot in advance.
0
Comment
Question by:kspuea
6 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 2666357
Sorry if this is a repeat. I got a time-out during the first submit.


The person who told you that was KIND OF right. He was referring to Server-Side-Includes (SSI), which is enabled on many Apache servers. The command is actually
<!--#include virtual="filename.shtml"-->
NO SPACES except between include and virtual! Make sure it's exactly as shown above. I've gone days of troubleshooting to realize I had forgotten the pound (#) sign in the include command. You can find more on SSI at BigNoseBird's site:
http://bignosebird.com under Server Side Includes. This is a great command for managing websites once you're used to the commands.

Rename both files' extensions from HTML to SHTML, and it should work. What host are you with?
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2666390
Indeed it all has to be done server-side. But not necessarily with the #include file.
You can also write your own javascript / vbscript-function which takes a file as a parameter and then read the file, and place it in your other html file.

Javascript:

<script language=javascript runat=server>
<!--
  var fso, f;
  fso = new ActiveXObject("Scripting.FileSystemObject");
  f = fso.OpenTextFile("c:\\yourfile.html", 1);
  document.write(f.ReadAll());
//-->
</script>

VBScript:

<script language=vbscript runat=server>
<!--
function WriteOutText
  Dim fso, f
  Set fso = CreateObject("Scripting.FileSystemObject")
  Set f = fso.OpenTextFile("c:\yourfile.html", 1)
   WriteOutText = f.ReadAll
end function
//-->
</script>
0
 
LVL 1

Expert Comment

by:rtieland
ID: 2668167
Hi,
External Source Files
take a look at this page
http://www.dansteinman.com/dynduo/en/source.html

look by technique 2

this is a script wich makes it possible to read in an external file and put it into a DIV tag.

yours,
ruben
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:kspuea
ID: 2668556
Hi gr8gonzo, thanks for your help. I have tried your method but unfortunately my server is a Lotus Domino server,not Apache server. So the method doesn't work. Furthermore, my HTML coding is all in Lotus Notes Forms. So I can't do like you said "rename the html file to shtml".

CJ_S, I have tried your method too. Unfortunately, I have this error message - "Automation server can't create object". Thus your method also doesn't work for me.

rtieland, I have taken a look at your reference. I will try it out after I digest the codes.

Sorry, pls bear with me. I'm new in HTML & Javascripts.

Thanks very much for all your help.


0
 

Accepted Solution

by:
Rich6176 earned 50 total points
ID: 2777356
This can be done with either SSI (server side includes as stated above or you can create a table and in the background property put the location and name of the .html file you want embeded.
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 2777842
Meaning that you don't have read / write permission at the server.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question