9

Why is it Frames were deprecated in HTML5 but not iFrames. After all, there is almost no difference between the two. In many instances using either of them would give the same output (pardon me if I am Wrong)?

  • An `iframe` functions like most other `block` DOM elements, excepting that it's contents are the "root" of another DOM. The same cannot be said about `frame`s (which live in a `frameset`) and are defined in rather fixed ways wrt the display port. –  Apr 15 '12 at 05:39
  • On Programmers: "[Why were frames deprecated in HTML5, but not iFrames?](http://programmers.stackexchange.com/q/144515/184857)" – WBT May 24 '16 at 19:00

3 Answers3

3

Inline frames are used to embed "plugins" into parts of a page. Seen google maps on a website before? Those are iframes.

Actual frames on the other hand are quite pointless. They're virtually never used in professional websites. If you ever go to a high school you may see IT projects that use frames for "navigation bars" or something. They take up half the page (or however you configure it) and are loaded as a separate page.

Simply put: iframes can be used as plugins. Frames are inelegant and not very useful

Edit: To be more specific, iframes and frames are quite different. Using my google maps example, and iframe would should a little box on the page as you're use to it. A plain frame would take half the screen to display (you can set up many frames so that a particular frame is in the middle of the screen, but why do that when you can use an inline frame?)

Raekye
  • 5,081
  • 8
  • 49
  • 74
  • 1
    I don't think they are useless. I have used them to build interfaces to old-school browsergames just fine. You could do actions such as throwing spells in a drop down menu on the right side, and the central main window gets updated - all without any javascript involved. How to achieve this without frames nowadays? – shevy Mar 25 '15 at 15:29
  • Many people forget the world existed before AJAX, DHTML, CSS, and JavaScript – Matthew Whited Sep 04 '16 at 10:10
  • Here is a page demonstrating an application that I am working on for my day-job (not with MIT). It's an embedded search through a 3rd party API. A donor can go to the "Type employer or company name here" text box, and search results are returned from matchinggifts.org on the mit.edu web page: https://giving.mit.edu/matching-gifts – tbc0 Nov 06 '17 at 22:35
0

Frames were a great feature in previous versions of html. However for many reasons(most of which are beyond my understanding) they were removed. Iframes are used for embedding applications and frames are used for other things like templating.

Frames had a wierd behavior in the browser though, the url does not change (like this website) even if the source of a frame changes. This is because you are viewing multiple web pages at a time with frames. In html5 this made no sense(iframes and frames do mostly the same things but the frame tag has a bad specification) and the w3c removed them because they were deprecated for a while anyway.

Max Zlotskiy
  • 114
  • 5
  • Framesets were discouraged even in HTML 4.01. It had nothing to do with the "two companies in charge" of HTML5 (which is the W3C, who also wrote the HTML 4.01 standard). – Karl Giesing Jan 07 '15 at 14:34
0

<frame> work completely different than <iframe> and are generally non-user friendly. Most implementations are such that the site's main address always appears in the address bar, no matter where you are in the site. This makes it next to impossible to bookmark the page, send a link to another, etc.

Basically, frames are the 'goto' statement of the HTML world. Sure, they can be useful, and they can be done well, but most of the time it's just bad programming done by bad programmers.

Mark
  • 6,762
  • 1
  • 33
  • 50
Banacek
  • 21
  • 2