Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do people still use iframes? [closed]

Tags:

iframe

People also ask

Why do people still use iFrames?

Developers mainly use the iframe tag to embed another HTML document within the current one. You may have crossed paths with it when you had to include a third-party widget (like the famous Facebook like button), a YouTube video, or an advertising section on your website.

Are iFrames being phased out?

IFrames are not obsolete, but the reasons for using them are rare. Using IFrames to serve your own content creates a "wall" around accessing the content in that area. For crawlers like Google, It's not immediately clear that cotent in an iframe will be ranked as highly as if the content were simply part of the page.

Why you shouldn't use iFrames?

Reason 1: Iframe causes usability issues The content, displayed in the iframe, could break (as it doesn't fit in the iFrame) and therefore look odd. The main purpose of displaying content on your website is to convince your users to book, so it should always look good.

Why do people hate iFrames?

A lot of people confuse web applications and web pages and confuse the proper uses of iFrames with improper uses of iFrames. Many have not been put in a position where iFrames are necessary and thus deem them useless overall.


I can think of 2 reasons (at the moment) why people would still use iframes instead of AJAX:

1) Iframes circumvent the cross domain origin policy (images, scripts, and styles do not). This can be useful for pulling in sites / content from other domain names relatively safely. Basically, this allows the advantage of being able to visually show data from other domains without letting them stomp all over your page with unlimited access (like something like JSONP would be able to do).

2) You can load multiple types of resources from within an iframe, not just certain mime-types (you're relatively limited to application/javascript, application/x-javascript, text/css, text/xml, image/png, image/jpeg, image/gif with scripts, XHR, images, and sources). For instance, if I want to show you a PDF, I can open an iframe and let the Adobe Reader plugin show you that file. Additionally, in the same domain, if I want to pipeline a script, style, and image all together (inline on the page, image would have to be data URI), I can accomplish this with an iframe (and if it's in the same domain, port, and protocol I can access it with JavaScript as well).

Did you know that Gmail is a set of iframes? The visible part is just clever positioning. Additionally, many OAuth implementation (Twitter, Facebook, Google, Yahoo!) usually use iframes to associate a user on their domain with a successful authentication URL (for after the user logs in).


IFRAMEs are used to embed and isolate third-party content into a website.

Most of web advertising solutions are based on iframes - because they give security (cross-domain policy) and isolated rectangle on screen which can be fully managed by third party content and scripting (a common use case is advertisments).

Another modern use of IFRAMES is a management of history (common back button workaround) of AJAX applications.

FRAMEs are poor version of IFRAMES. Their use is declining.


If a user has javascript disabled, iframes will work when ajax doesn't. This is not out of the question, considering that people use things like NoScript.


I use them on ajax websites, when I need to upload files without reloading the page.


I still see iframes being used in large corporations where they provide a single sign on which injects header information about the authenticated user which is then passed, via an iframe, towards the actual application(s). Since the "portal" surrounding the iframe handles all the specific authentication details those applications behind it don't need to have each an implementation for it, making things easier to make for the development team and having a single place to monitor and adjust authentication details of users.