Getting contradictory messages about that, hope they're not. I cannot imagine support for it would stop, since a gazillion sites use them.
Some additional questions about that:
- Why should they phase out this tag?
- Any alternative for it?
tx
Getting contradictory messages about that, hope they're not. I cannot imagine support for it would stop, since a gazillion sites use them.
Some additional questions about that:
tx
IFrames are not obsolete, but the reasons for using them are rare.
Reasons for using iframes:
I would also answer that there is no need for the removal of iframes, it's a needed tag and will be around for a while.
IFrames are used a lot with AJAX. GMail for example, uses nine hidden IFrames I believe.
Support for <iframe>
is still there in HTML 5, so I don't think this will change in the near future.
To answer your other questions:
<iframe>
s (as frames in general) are most of the time not user-friendly:
<div>
To be clear: I'm talking about <iframe>
as a interface element. Not a hidden element for loading other stuff like e.g. Google Mail does.
I've just changed a site from a normal Frameset to Iframes as normal frames couldn't do what I needed. It caused no issues with the rest of the codebase.
Iframes are obsolete for page layout. Never use them instead of good CSS layout, even table-based layout is better.
Good reasons for using iframes are:
At my previous company, we provided a hosted application that customers would integrate into their own websites. At times, they would use an IFrame to do this, fitting our hosted page into their existing designs. Sometimes this was even done seamlessly (ie. the IFrame had no borders or scrollbars, it just looked like part of the page). I considered this to be a good use of the tag.
They can be extremely useful in some circumstances, but those are limited. In particular embedding common functionality across multiple sites.
For example I have a client who runs a number of Scottish goods e-commerce sites. As part of this we have developed a couple of simple applications to locate possible clan names from your surname or your choice of tartans (giggle if you wish but tartans are worth $700 million a year to our economy). The database behind this is surprisingly large (nearly ten thousand rows in the core names and tartans tables) and fairly regularly updated.
So we have the applications set up to run on one website and then embedded these into our other websites using an iframe, enabling simple javascript parameter passing so we can integrate the selection of a tartan or clan with functionality on the embedding site. The iframe is set as noborder so it appears completely seamless to the end user.
Of course there would be other ways of doing this, but the use of an iframe is simple and robust. And it's certainly not obsolete.
IFrames are not dead, but Frameset/Frames are dying.
In the last 2 releases of IE (IE7/IE8) zooming in Frames (not IFrames) has created disastrous results.
By all means use IFrames, but IMHO stay clear of Framesets/Frames.
In my opinion the W3C jumped the gun in dumping iframes from the Strict HTML and XHTML doctypes. In theory you would use the <object>
element to add foreign objects to your document, but browser differences and limitations have made this a nonstarter for many developers. With the much-more-pragmatic HTML 5 (which is still a draft), iframes are back and even have two new attributes: seamless
, and the intriguing sandbox
.
The google gadget specification currently relies on iframes: http://code.google.com/apis/gadgets/docs/spec.html
Currently they are the only simple way to provide isolation for javascript apps that are pulled from multiple domains/providers.
Also many of the widgets that people embed on their websites from third-parties use iframes.
While they do have their drawbacks, iframes provide a pragmatic solution to common problems on the web. I'd have to guess that they will be around for some time to come.
I work for a company that used frames for everything from pull down menus, lists, content blocks, etc just to cover the intricacies of .net web forms. The application is very slow and only runs on IE. Don't do this.