Solved

Embed HTML in HTML

Posted on 2003-12-01
10
3,487 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
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jquery, html5 UI 1 49
Newbie CSS questions 4 27
Modify Table Width 6 14
while loop in html mail format 5 32
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now