Solved

Embed HTML in HTML

Posted on 2003-12-01
10
3,493 Views
Last Modified: 2009-11-08
I would like to include a HTML (full page and without scrollbar) into another HTML. I had tried to use #include but its not work at all, and I also tried to use <iframe> but it is needed to specify the height of the frame, it is not good for my page (double scrollbar, one for frame and one for window). The HTML whick needed to embeded with several pages with different height. Therefore, I would like to embed the html page with dynamic height which depends on the height of the embeded page size.

Are there any methods ?

Thanks a Lot and I am hurry.

Regards,
sL
0
Comment
Question by:sLso
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 2

Expert Comment

by:HeadAcheMike
ID: 9857593
you could tdo it the php way (presuming php is installed on your server):

<?php
include('file.html');
?>

the contents of the file file.html will be written into the main file thats calling it
note: the extension of the page will have to be changed to .php
0
 
LVL 17

Accepted Solution

by:
dorward earned 35 total points
ID: 9857671
0
 
LVL 25

Expert Comment

by:James Rodgers
ID: 9857961
try this, uses javascript to resize an iframe, just change the iframe width to what you need

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
      <title>Untitled</title>
      <script>
      function resizeToContent(){
      var x =document.getElementById("dynamIframe").scrollHeight;
      var z = x-200;
      var y =screen.availHeight;
      while (x < y){
            x+=1;
      }
      x-=z;
      document.getElementById("dynamIframe").style.height=x
}
      
      </script>
</head>
 
<body onload="resizeToContent()">


<iframe id="dynamIframe" src="users.cfm" width="180" height="75" hspace="0" vspace="0" frameborder="0"><frame src="users.cfm" width="180" height="75" hspace="0" vspace="0" scroling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</body>
</html>
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:gam3r_3xtr3m3
ID: 9858112
PHP:
<?php include('file.html'); ?>
ASP/SHTML:
<!-- #include file="file.html" //-->

>> ...I would like to embed the html page with dynamic height which depends on the height of the embeded page size.
what should be the size of the embedded page size? the whole page? as in the whole? you could do it dynamically somewhat like this...:

<body topmargin="0" leftmargin="0">
<iframe marginwidth="0" marginheight="0" borderwidth="0" framespacing="0" frameborder="no" scrolling="no" onLoad="this.style.height=screen.availHeight; this.style.width=screen.availWidth;" src="embed.html">
How can i embed if you don't have iframes???
</iframe>
</body>
0
 
LVL 1

Author Comment

by:sLso
ID: 9863318
gam3r_3xtr3m3,

The height is the whole page of the embedded website. For example, if I using iframe, the frame no scrollbar is needed. The iframe's height is equal to the embedded page's height. Only the window's scrollbar is needed.

But the embedded website's pages with different height. So, I would like the height of the frame with dynamic height if I using frame.

Many Thanks,
sL
0
 

Expert Comment

by:Nelson_Pires
ID: 9866416
The include method works, but you need to rename the calling page to .SHTML or .SHTM, since the includes are SSI (Server Side Includes) so the server must be able to process them, also note the include can be file or virtual, observe:

<!--#include file="file.html" -->
<!--#include virtual="file.html" -->

Hope it helps.
0
 
LVL 3

Expert Comment

by:IGneon10
ID: 9870730
all you need is to embed this into the exsisting HTML file:
<iframe src="embeddedpage.html"></iframe>

For an example an attributes you can use, go to the site W3Schools has on it:
http://www.w3schools.com/tags/tag_iframe.asp
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses four methods for overlaying images in a container on a web page
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

739 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