Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why should I not use HTML frames? [closed]

Tags:

I haven't used frames since 1998. They seem like a bad idea and in all my development I've never had a situation where frames were the right solution, or even a decent solution.

However, I'm now working with an internal web application written by another group and the entire site is built in a - header, left side menu, right side content - frameset.

For one, when VPN'd to my network I constantly get a "website.com/frames.html" cannot be found." error message. This doesn't happen when I'm on the internal network.

Second, the app has a built in email/messaging system. The number of unread messages is shown in the left side menu frame as "Messages (3)" but the count doesn't update as I read the messages. The developer told me since it was in a frame I needed to right click on the menu and 'Refresh'. Seriously????

So, my programming related question is, what reasons do you have for not using frames in a website?

like image 648
rvarcher Avatar asked Jul 29 '09 21:07

rvarcher


People also ask

Why are HTML frames bad?

Frames are more difficult to bookmark and, therefore, more difficult to share with others.

Why HTML frame should not be used while designing website?

For example, frames can reduce the amount of usable space on a page, they make it difficult or impossible for users to link directly to or bookmark a specific page within a frameset, and they often prevent users' Back buttons from working as expected.

Are HTML frames deprecated?

Frames are now deprecated in HTML5, but the ability to place one document inside another still exists. You can do this in an [ ](/tags/iframe/). And it is important to realize that is not simply a renamed or updated version of . An is an “inline” frame (or, some would call it, and “internal frame).

Are framesets still used?

frames and framesets are completely obsolete in HTML5.


5 Answers

Although they solved a problem at the time they were created (updating part of a "page" while keeping in place a non-updating part), framesets were criticised in terms of usability pretty much from the start, as they break generic functions of the browser, such as:

  • bookmarking, and copy-and-pasting URLs to share
  • printing the page as displayed on the screen
  • reloading the page: since the URL has generally not changed, you will often be taken back to the site's homepage or default frameset; manually reloading some frames is possible, but not obvious to the user
  • back and forward buttons are ambiguous: undo/redo the last frame change, or take you to the last time the URL bar changed?

The heaviest burden of avoiding framesets - including the same content on every page - is trivial to solve if you are using any server-side language to generate your HTML, even if all it provides is a "server side include". Unlike framesets, a server-side include could occur anywhere on the page; building a site with a server-side scripting language or templating system has other obvious advantages too.

There is still an advantage to being able to update small areas of the page without reloading the entire content, which can be achieved via AJAX. This sometimes leads people to create interfaces with all the problems of framesets outlined above, but that is hardly an argument in favour of framesets. Again, a site built with well-designed AJAX functionality can achieve things which framesets don't even begin to address.

like image 86
IMSoP Avatar answered Oct 04 '22 22:10

IMSoP


One good reason to avoid frames today is they have been deprecated in HTML 5: Chapter 11 Obsolete features

11.2 Non-conforming features

Elements in the following list are entirely obsolete, and must not be used by authors:

[...]

frame

frameset

noframes

Either use iframe and CSS instead, or use server-side includes to generate complete pages with the various invariant parts merged in.

like image 26
Simon Mourier Avatar answered Oct 04 '22 20:10

Simon Mourier


The #1 reason? Users hate them.

Even if they offered advantages in other areas (separation of code, application design, speed etc) they are part of the user interface. If users don't approve, don't use them.

like image 35
Spencer Ruport Avatar answered Oct 04 '22 22:10

Spencer Ruport


Frames were vaguely useful when you had a static web site, to avoid repeating navigation menu in all pages, for example. It also reduced the overall size of a page.

Both these arguments are obsolete now: sites don't hesitate to serve fat pages, and most of them are dynamically built so including such navigational parts (or status, etc.) has no problem.

The "why" part is well answered above, partly by your own question (you hit a limitation, although it can be overridden with a bit of JS).

like image 45
PhiLho Avatar answered Oct 04 '22 20:10

PhiLho


My number 1 reason not to use frames is because they break the bookmark (aka favorite) feature of browsers.

With the technology that exists today, frames have become obsolete. But if your legacy project still uses them, you can make the messages update with some ajax.

like image 21
Peter Di Cecco Avatar answered Oct 04 '22 21:10

Peter Di Cecco