Debate over iFrames in HTML
Recently, I have been dealing alot in iFrames - the new version of FRAMESET in HTML and while designing web pages, all I look for is - maintainability, platform compatibility, design aspects, extensibility, search engine optimization and user friendliness.
So, a question just pop-up in my mind while using iFrames in one of my projects for my organization. Whether to use iFrames or not? I found - its always better to stay away from it. Why? Come along with me...
First, iFrames cause problems with accessibility or cross-browser compatibility.
Let's evaluate on some other points: search engine optimization, usability, consistency, and flexibility.
SEO - Search Engine Optimization
Using an iFrame makes impossible for Google or any other search engine to index your site efficiently. Search Engines send out robots(also called as Spiders) to crawl websites, and when they find a page with an iFrame.The spider has no way to recognize the content inside - black hole for the spider! So, if your page(one in the iFrame) has some links within it, they too are not indexed.
User Friendliness - limited viewing options
Maximizing browser, saving pages, closing a window are not possible with pages inside iFrames.
There is no way to bokmark the pages in iFrames. User also can not get rid of the scroll bars on the page.
User usability - Problems with printing
Only the visible content will be printed When printing a page that contains an iFrame, only the visible content will be printed. If an iFrame has a scrollbar, and requires scrolling, a printout will not be able to show all of the data in the iFrame.
No Browser history
Since browser views an iFramed site as a part of the main application, browser may not log all the clicks of sub-site in the iFrame.
No Context Maintainence
The context of the sub-site (one in the iFrame) can not be changed. So, the sub-site can not be controlled by the master application. Sessions of the sub-site can not be destroyed, the page of iFrame can not be captured.