When the frames "glowed"
Frames were often used on static pages where it is not possible to do include on the server.
For example, on a pure HTML site, header, footer and menu should be repeated on each page. This was a big problem and the frame solved it perfectly as well as saving on loading time.
Software like Dreamweaver mitigated this problem by allowing us to generate all pages of the site from a template, changing only the content of each of them.
Today, where any server has at least PHP, it is better to use some CMS (Content Management System) or simply includes to build the page and automatically add each necessary element to it.
Lack of pattern
Frames are also bad because they break the traditional web content template by displaying multiple independent pages on the same screen.
This can cause usability problems, mainly because it may not be intuitive for him, especially if he usually uses the back and forth buttons.
Frames are also not very intuitive because they can mix content from different domains and it is not always clear to the user that a particular frame belongs to a different website.
Complexity in development
In my own experience working with banking systems I see that using frames usually generates problems at some point.
The frame hinders development in several aspects:
- It is often necessary for one frame to communicate via Javascript to another, this can cause problems from XSS to mixing versions and instances of Javascript libraries (like jQuery) in different frames.
- Frameworks Component-based as JSF or Struts may have unexpected behaviors when used in different frames. as they are not designed for this.
- Safety restrictions on general browsers crashes and unexpected behaviors.
- Redirects resulting from actions in the system do not work well in frames, since only the frame would be redirected. Often it is necessary to create additional and complex code to make a "global" redirect of the page.
Anyway, the scenarios above were just a few cases that I could remember.
About indexing in search engines
The search engines could identify the various frames (if they were static) or at least through some map of the site.
As already mentioned, there was a problem when a visitor entered the site directly on one of the pages that is not the Frameset leading.
In this case, many websites used Javascript to check if the main frame was there and, if not, redirect the user to the root of the site. I remember that this used to generate several usability problems.
Exception for iframes
Unlike traditional frames, the iframe
s have some valid use cases, the main one being to allow the independent rendering of a page location in a secure way, that is, without the content of that site can interfere with the rest of the page.
This technique is widely used in advertising systems (Advertising) digital, such as Google Adsense.
The advantage of iframe
is that it does not slow down the main site and does not allow the site to change information on the advertisement banner and vice versa.
At Atlassian, products like Jira and Confluence when used in the Cloud cannot have plugins installed directly as in the server version. However, the company has developed the technology called Atlassian Connect which consists precisely in the possibility of extending the products by adding frames in strategic locations that receive only the information selected from the page context. The rest of the communication is done using Restful Web Services and Web Hooks.
So I would say that the main application of iframes
today is integration between different web applications safely and independently. This approach tends to grow with the news from HTML5 to create a sandbox more restrictive and therefore safe for certain uses.
Some libraries also use iframe
s to simulate AJAX requests when the browser does not support certain features. For example, the Jquery File Upload does this to submit files if the browser does not support the latest technology to make asynchronous uploads. However, this use tends to disappear as browsers evolve.
Psychologist Abraham Maslow coined a phrase that perfectly describes this situation: 'I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail. Those who like (and trust) frames/iframes will continue to advocate use.
– OnoSendai
The question on the topic is: what are its benefits and harms?... and why was it considered obsolete?
– MarceloBoni
Related: What is the modern alternative to framesets?
– user7261
@Andréleria veja the review and will understand the comment.
– Mansueli
frames and iframes are two very different concepts, too bad none of the answers addressed the subject well, including iframe as a modern solution to replace the frame here: http://answall.com/a/15174/ -Not only the
iframe
has its place, as is a modern alternative (so much so that it gained new powers with HTML5). Sopt himself and many other sites use it in the right way.– Bacco
@Bacco Good observation. I updated my answer.
– utluiz