views:

544

answers:

11

I was talking with a colleague about a problem we were having and he suggested that one possible solution was to use an IFrame.

I haven't needed to use an IFrame for he last 5 years and I've done full time web application development, but it made me wonder if the concept of the IFrame and Framesets is something that is supported by browsers for backwards compatibility but really shouldn't be actively used in development any more?

+9  A: 

It's the fastest and easiest way to get any of a number of google services into a web page, where the fuller control of the API integration is not needed.

Like anything else, it is situational. It's far from dead, and there's no reason it should be dead. The web's moving to looser coupling, and IFrame is in line with that.

Russell Steen
agreed.@ lomaxx, just because you dont use it does not deprecate it :)
Salvin Francis
+6  A: 

it's one of the major application integration methods for facebook and myspace. and most wysiwyg html editors rely on iframe. thickbox uses iframe. drupal uses iframes. and on and on... so not sure if it's so very simple to just call iframe obsolete. i imagine it'll be actively used for a good long while still...

Scott Evernden
+1  A: 

It's extensively used in ad tracking and conversion tracking; it's one of the easiest ways to put a beacon into a site unobtrusively.

Tim Howland
+2  A: 

At best the IFrame isn't ideal for rendering local content, but, like others have said, it is the only way to get external web-content into an application without an API and for that reason it is very important to modern web-development.

Nathan Taylor
A: 

if the company doesn't have the budget to re-develop/integrate the functionality properly then you will have to put up with mr iFrame for a little while longer :(

andrew
+2  A: 

No, it shouldn't.
It's a cheap standard way to integrate functionality in a single page. Also allows some useful techniques such as COMET

Matias
+2  A: 

Not sure if it should be dead. For one of the application I worked on for the manufacturing industry, they wanted multiple tabs to be able to run multiple programs on the same page. Knowing using just regular divs using Ajax would just be a little too much for this intensive app, we used iframes. Of course, it doesn't look like iframes to the end user (using some creative Javascripting and CSS), it looks like just a regular tabbed program.

So, saying it's dead is probably a little too soon unless there are better alternatives.

Dhana
A: 

I think that iFrames are not dead yet, they can be used for a lot of things and though they slow the loading speed of a website (with a few miliseconds, depends on the content). iFrames maybe, Framesets NO. this is what i think. some things can be done only with iframes believe me i searched for another solution for a long time but for eg. a jscript can be used 2 or more times with iframes but when used on a single page it may cause conflicts and sometimes only the first thing that was using the javascript is working. so sometimes iFrames are the right way to do it, if you can`t do it any other way.

DanTdr
A: 

No, its commonly used in junction with AJAX.

For example, on a page where you have ongoing AJAX requests you can't disrupt the response by closing it etc. BUT, you may need to provide a file download on the same page which would normally disrupt the AJAX request. To avoid the conflict, you serve the file download through an IFrame so that the AJAX on the host page isn't disrupted.

That's at least one use case for it =)

TJB
A: 

Iframes are not dead. They are the only method of fighting several extremely annoying bugs in MSIE (such as div overlapping a <select>), and are widely used in banner exchange networks.

n1313
A: 

If you consider the fundamental building blocks of the web you will realise that the iframe should never be removed. I have the feeling that many web developers do not properly understand the concepts of data centric systems and prefer to work in a procedural, top-down, application centric manner. There are many things done with async HTTP requests and Javascript that should simply use an iframe.

There are two fundamental concepts when it comes to linking content in a data centric world like the web - cross referencing and embedding. Hyperlinks are used to cross reference data while iframes are used to embed data. URLs are used to reference data in both cases.

A simple example is linking to an image. Cross referencing an image would be done as follows:

<a href="someImageURL">Link to the image</a>

While embedding an image would be achieved as follows:

<iframe src="someImageURL" />

Of course you could use the "img" element to embed an image instead, but that is specific to images... I vote that the "img" element be removed in favor of using the more generic and flexible iframe.

Daniel Paull
This is a good point. Why is it that when we reuse an image around a page we reference it with the img tag, but normally if the same bit of html will be displayed in multiple places it is repeated, regardless of its complexity. Iframes are a good way to wire up web components, like for example the widgets that appear on the google home page.
Jesse Pepper