I heavily use IFRAMEs like they were subform/subreports in Access...
I currently use them on IIS5 with ASP.
Here are some suggestions on how I have used IFRAMEs in the past:
Syntax:
Code:
<iframe allowtransparency="true" name="SomeIFRAMEName" src="<%=strListURL%>" border=0 frameborder=0 width=100% scrolling=auto height=100%>
Some kind of text for users with such old browsers they can't see IFRAMES...
</iframe>
The attributes I use the most are:
[ul][li]Name: I use this so I can refer to the IFRAME in Javascript.[/li]
[li]scrolling: this rocks... you can have a tiny iframe in the middle of the screen with its own scroll bar, as opposed to the traditional frameset that restricts you to full quadrants of the page.[/li]
[li]I haven't really toyed with the width and height attributes of the IFRAME much, but I do put the IFRAME tags inside tables or divs... fun to use in DIVs with some JS to make them draggable... [/li]
[li]src=<%=someASPVariable%> this is useful... so that you can control what content goes into the IFRAME with scripting.[/li][/ul]
The two ways I control the content of the IFRAME are either at page load, with the last point mentioned above, or with javascript:
Code:
document.SomeIFRAMEname.location = "anotherpage.asp";
In a sense, treat your IFRAME as if it was a DIV... and you can place it inside any block of HTML code (Tables, paragraphs, etc...)
HEre are some links that might help:
And you can see an example of it here:
This object is defined in HTML 4.0 and is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1.
-from MSDN's page on IFRAME
happy coding!
Earnie Eng