Load iFrame with content from the parent page???

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I'm generating HTML from a 3rd party product (SAS Stored Process Web
Application).  It is a Java application hosted by JBoss.

For reasons too boring to explain, I don't have complete control over
the code (HTML) generation process.

What I want to do is use iframes, but have the iframe content
contained in the parent page itself.

In pseudocode:


<!--  I know this wouldn't work, it's just to illustrate a
concept ;-)
dynamic_generated_content from the application server...

<iframe src="static_content.html" width="100%" height="10"
scrolling=no frameborder=no>
<iframe src="dynamic_generated_content.???" width="100%" height="500"
scrolling=yes frameborder=no>


Can I generate "inline" content in a web page, and have it displayed
in an iframe in that same page?  Or do I have to save this dynamic
content somewhere, then point the src= attribute to that location?

I would much prefer option #1 if possible.  If option #1 is possible,
does it matter whether the inline content is before or after the
iframe definitions?


Re: Load iFrame with content from the parent page???

31.10.2011 1:25, Scott Bass wrote:

Quoted text here. Click to load it

But what do you _really_ want to do? The iframe element means, by
definition, certain kind of inclusion of external content. So you are
are effectively asking "how do I include internal content as external",
which doesn't make much sense as such.

The iframe inclusion mechanism has several features, often regarded as
drawbacks but tolerated because they're the price for including external
content in an "HTML-only" manner. So which features of this mechanism
would you like to use for internal content, i.e. something that you have
or can set up as an element of an HTML document?

Quoted text here. Click to load it

This suggests that you want to set the height to 500 pixels and have
scrolling when the content doesn't fit into that. (A width of 100% is
the default for a block element in HTML, and so is the absence of a border.)

This could be done simply by wrapping the content inside

<div style="height: 500px; overflow: auto">

(or more elegantly, a <div> element with a class attribute, using an
external stylesheet to set the style properties).

Yucca, http://www.cs.tut.fi/~jkorpela /

Re: Load iFrame with content from the parent page???

Quoted text here. Click to load it

Hi thanks for the reply.

What I _really_ want to do is have content at the top and bottom of
the page (say a "header" and "footer") that doesn't scroll, and have
dynamically generated tabular content in the middle of the page that I
can scroll both horizontally and vertically.


Re: Load iFrame with content from the parent page???

In article

Quoted text here. Click to load it

As for the header, perhaps this might be useful to you:



Re: Load iFrame with content from the parent page???

31.10.2011 9:15, Scott Bass wrote:

Quoted text here. Click to load it

This sounds simple enough - not trivial, given some complexities in CSS
and its implementations, but simple enough a job for CSS.

Define the header, the content, and the footer as <div> elements with
class attributes (or id attributes), e.g.

<div class=header>The header goes here.</div>
<div class=content>
<div class=footer>The footer goes here.</div>

Then use CSS to place the header and the footer at the top and at the
bottom of the browser window, respectively. You need to set their
heights, and the heights should be sufficient for any content you'll
have there.

Now, absolutely position the <div> elements, making sure the content
starts where to header ends and ends where the footer starts. Having
done this, setting overflow: scroll on the content element will do the
trick. The CSS code would be something like this:

html, body { margin: 0; padding: 0; }
.header { height: 3em; position: absolute; top: 0;}
.footer { height: 5em; position: absolute; bottom: 0; }
.content { overflow: auto; position: absolute; top: 3em; bottom: 5em;
    left: 0; right: 0; }

The HTML markup needed is very simple and the difficulty lies on the CSS
side, so I'm moving the discussion to the stylesheets group.

Yucca, http://www.cs.tut.fi/~jkorpela /

Site Timeline