[html5] [HTML5] HTML file inclusion

Jon Barnett jonbarnett at gmail.com
Thu Aug 2 14:28:19 PDT 2007


On 8/2/07, doekman at gmail.com <doekman at gmail.com> wrote:
> On 7/14/07, Master Leep <dojo at masterleep.com> wrote:
> > HTML5 contains a couple of elements which create nested browsing contexts,
> > namely iframe and object.
> >
> > Do either of these elements provide a safe replacement for Javascript
> > client-side file inclusion?
> >
> > For example, I'd like to have an element which will be replaced by the HTML
> > in another referenced document.  I don't want to have to specify height or
> > width from the parent document or risk having scrollbars appear, if those
> > scrollbars wouldn't appear if the HTML had been all one document.
>
> You mean something like:
> <p>
>   You can <a href="specs.html" target="_replace" for="container">get
> the specs</a>.
> </p>
> <div id="container">
>   <!-- specs come here-->
> </div>

This could be accomplished with just an iframe is there was a way to
make <iframe> size itself automatically according to the its contents.
 I've mentioned this before.  Regarding "replaced elements", CSS
doesn't say anything regarding the integral dimensions of an <iframe>.
 Most browsers (all graphical browsers?) just assign a default height
and width if none are specified on an <iframe>.  If HTML could define
the integral dimensions of an iframe to auto-fit its contents, that
would be nice.  Even if that required an extra attribute on the
<iframe> I'd be for it.

Auto-sizing an iframe is fairly difficult to do with javascript, and
pretty much impossible if the embedded document is on a different
domain as the parent document.

-- 
Jon Barnett



More information about the Help mailing list