h1

iframe bye-frame?

December 17th, 2002

I’m building a web app in which I build the page from components. A section here on the page with its own elements, layout and control code, another one over there, insulated from the first. I’m using iframes because each one is self-contained, has its own JavaScript and DOM namespace, styles etc.

An alternative might have been to house each component in a positioned DIV, but the namespace issues and the dynamic reloading of the components made iframe the perfect tool.

Unfortunately, iframes seem to be being pushed out of the picture. XHTML Strict has no support for iframe. I understand it is to be deprecated.

In order to emulate the functionality that iframes provide, I may have to write code that enforces namespace via prefix and then div-loading code.

Anyone got any better ideas?

14 comments to “iframe bye-frame?”

  1. I think they want you to use the object element instead. See the note at the end here: http://www.w3.org/TR/html401/present/frames.html#h-16.5

    Btw, the new XHTML 2.0 draft proposes to allow a src attribute on *any* element!


  2. Brent, based on what I figure you are trying to do, it looks like the method Sjoerd commented on is the way to go. See http://www.w3.org/TR/xhtml2/mod-object.html#s_objectmodule in the XHTML 2.0 draft.

    Also, it seems that the first working draft of XFrames http://www.w3.org/TR/xframes was published at the same time as XHTML 2.0. According to this quote:

    “XFrames is an XML application for composing documents together, replacing HTML and XHTML Frames”

    you can see they’ve moved it out of XHTML.

    Not much mention of iframes at all as they seem to have just dissappeared.


  3. Is compliance with XHTML Strict really so necessary that we have to rob ourselves of such functionality? Until we have browsers that actually support XFrame (and assuming that we’re permitted to use them inline as we are with IFRAMEs), why not stick with XHTML Transitional for the time being?


  4. Yes, that’s what we’re doing so far (transitional)but our plan is to make things as strict as we can because that will leave us in the best position to not have to do any big refactoring for the longest amount of time.


  5. “because that will leave us in the best position to not have to do any big refactoring for the longest amount of time.”

    In THEORY. In reality, browser still aren’t ‘standard’ and there really isn’t a guarantee they will be in the future, so you really aren’t guaranteeing that things will be easier down the road just because you’re sticking with the standards now.


  6. I wish the W3C would have provided an alternative to iframe BEFORE deprecating it in XHTML Strict. That might have been a good idea 😉


  7. I wish the W3C would have provided an alternative to iframe BEFORE deprecating it in XHTML Strict. That might have been a good idea

    AGREED. Using a src attribute in div tags in XHMTL 2.0 is pretty exciting though!


  8. I have used “object” for inserting html page, but it doesn’t work. do you have a live example?

    Thanks,
    Aryan


  9. Browser not supported works, except that it will not display in IE unless you use some CSS to manually set the dimensions.


  10. Apparently the blog ate my code. I currently have an example at http://dracserver.dnsalias.com/test/iframe.html (I can’t guarantee how long it will be there though)


  11. Can’t help technically but love the sound of this application.


  12. hi ashley – since this post is still alive in comments, try this…

    obtrusive iFrame with JQuery


  13. I read somewhere that this problem with iframes is fixed now. But I can’t find it anywhere anymore. Does sombody know if this is fixed?

    gr

    Karel
    The Netherlands


  14. It seems not to be clear if these problems are solved yet.Iframe is not the best functionality.