Jump to content

Frame (World Wide Web)

From Wikipedia, the free encyclopedia
(Redirected fromFraming (World Wide Web))

In the context of aweb browser,aframeis a part of aweb pageor browserwindowwhich displays content independent of its container, with the ability to load content independently. TheHTMLor media elements in a frame may come from aweb sitedistinct from the site providing the enclosing content. This practice, known asframing,[1]is today often regarded as a violation ofsame-origin policy.

InHTML,aframesetis a group of named frames to which web pages and media can be directed; aniframeprovides for a frame to be placed inside the body of a document.

Since the early 2000s, concern for usability and accessibility has motivated diminished use of framesets and theHTML5standard does not support them.

Tags and attributes[edit]

The frames in HTML are created using the<frameset></frameset>tag pair. The<frameset>tag is a container tag for all other tags that are used to create frames. The<frameset>tag replaces the<body>tag in frameset documents.The<frameset>tag defines how to divide the window into frames.

Each frameset defines a set of rows or columns. If user define frames by using therowsattribute then horizontal frames are created. If user define frames by usingcolsthen vertical frames are created.

The<noframes>element may be included so web browsers with frames disabled (or browsers that do not support frames) can display something to the user, as in this example:

<framesetcols="85%, 15%">
<framesrc="http:// example /frame_1.html"name="frame_1">
<framesrc="http://alt.example /frame_2.html"name="frame_2">
<noframes>
Your browser does not support frames.
<ahref="http:// example /frame_1.html">Click here</a>to view frame 1.
<ahref="http://alt.example /frame_2.html">Click here</a>for frame 2.
</noframes>
</frameset>

Framesets have aborderattribute. If set to an integer greater than 0, the user can resize the frames by dragging this border, unless anoresizeattribute is present in a frame element. If border is set to 0, no border will be displayed and content in different frames will abut each other without delineation.

Theiframeelement is used inline within a normal HTML body, and defines the initial content and name similarly to theframeelement. Any text inside an<iframe></iframe>tag pair will be displayed in browsers that do not understand the iframe tag.

<iframesrc="http:// example /frame_1.html"height="480"width="640">
Your browser does not support iframes.<ahref="http:// example /frame_1.html">Click here</a>to view the content.
</iframe>

History[edit]

Netscape Navigator2.0 introduced the elements used for frames in March 1996. Other browser vendors such asApplewithCyberdogfollowed later that year.[2]At that time, Netscape proposed frames to theWorld Wide Web Consortium(W3C) for inclusion in the HTML 3.0 standard.[3]

Frames were used to display and navigate earlyonline magazinesandweb apps,such aswebmailservices andweb chatsites. Frames had the advantage of allowing elements to be displayed sitewide without requiring server features such asserver-side includesorCGIsupport. These features were not common on early web servers accessible to the public.

Early websites often used a frame at the top to display a banner which could not be scrolled away. These banner frames sometimes included the site's logo as well asadvertising.[4]

XHTML1.1, the intended successor to HTML 4, removed all frames.XFrames,the intended eventual replacement,[5]provided the compositeURIto address a populated frameset.

The laterHTML5standard removed framesets by means differing from XHTML.[6]Theiframeelement remains with a number of "sandbo xing"options intended for sharing content between sites.[7]

Advantages[edit]

By allowing content to be loaded and navigated independently, frames offered several advantages over the plain HTML in use when they were first developed:

  • Simplifying maintenance of content shared across all or most pages, such as navigation data.[8]If an item needs to be added to a sidebar navigation menu, the web page author needs to change only one web page file, whereas each individual page on a traditional non-frameset website would have to be edited if the sidebar menu appeared on all of them.
  • Reducing the amount of bandwidth needed by not re-downloading parts of the page which had not changed.
  • Allowing several pieces of information to be viewed side by side, with the ability for each section to be scrolled independently. This might include the side-by-side comparison of two pictures or videos, or two different ways to understand something, such as an independently scrolling page of text next to video, images, animation, 3D rotating objects, etc.
  • Allowing footnotes or digressions to appear in a dedicated section of the page when linked to, so that the reader does not lose their place in the main text.

[9]

Criticism[edit]

The practice of framing HTML content led to numerous criticisms, most centering onusabilityandaccessibilityconcerns. These include:

  • Framing breaks the identity between the content andURLas displayed in the browser, making it difficult to link to or bookmark a particular item of content within the frameset[10]
  • The implementation of frames is inconsistent across different browsers[10]
  • Browsers which render material linearly do not handle frames well.[11]
  • Framing complicatesweb inde xingand can be detrimental tosearch engine optimization.[13]
  • Framing confuses the boundaries between content on different servers,[14]which raises issues of copyright infringement[15]
  • Visitors arriving from search engines may land on a page intended for display in a frame, resulting in the visitor having no way to navigate to the rest of the site[16]
  • Frames change the behavior of the back button.[16]
  • Users usually do not expect browsers to print frames the way they do.[15]
  • External links on web pages which use frames may cause other pages to appear in the frameset, since the default behaviour for a link is to load in the current frame if the author does not specify otherwise. This could be used by unscrupulous webmasters to make it appear as though content from another site was actually part of the site hosting the frameset.
  • If the screen resolution or browser window size is too low then each frame will have scroll bars which can look messy and uses up already limited space. Such behaviour typically resulted more from bad site design (fixed layouts instead of fluid layouts), whereby not all frameset features were put into proper use.
    This behaviour could be mitigated by:
    • disabling scrolling for smaller frames that typically did not require a scrollbar;
    • using fluid design characteristics in target pages instead of fixed designs, so that the content would not cause horizontal scrollbars in the first place.

Alternatives[edit]

As web technology developed, many of the purposes for which frames were used became possible in ways that avoided the problems identified with frames.

  • Cascading Style Sheets(CSS) allowed elements of a page to be scrolled independently (using theoverflowproperty) or held on screen while other content is scrolled (usingposition:fixed)
  • Server-Side Includesallowed shared content to be edited once and automatically delivered to the client as part of a finished page; as server CPU and connection speeds increased, the extra work required to do this on the fly became a lesser consideration.
  • CGIand web-orientedscripting languagesandweb developmentframeworks such asPHPandActive Server Pages,as well as database-backedContent Management Systemssuch asWordPress,provided much richer options for maintaining content and providing navigation.
  • Client-side scriptingandDynamic HTMLallowed parts of a page to be visually replaced based on a user's actions. This allowed much more flexibility for showing "side" content, such as footnotes or instructions, as these could now be displayed and hidden anywhere on the page rather than requiring a pre-defined frame.
  • AJAXallowed for dynamic display within a page of content even when it needs to be fetched from the server, for instance based on the logged in user or events elsewhere.

See also[edit]

References[edit]

  1. ^"Connecting to Other Websites".2 April 2013.What makes framing different is that instead of taking the user to the linked website, the information from that website is imported into the original page and displayed in a special "frame". Technically, when you're viewing framed information, your computer is connected to the site doing the framing—not the site whose page appears in the frame.
  2. ^Garaffa, Dave (23 December 1996)."A Present From Apple: Cyberdog 2.0a1"(Press release).Internet.Archived fromthe originalon 17 August 2000.Retrieved14 April2011.
  3. ^Ladd, Eric."Using HTML 3.2, Java 1.1, and CGI; Ch. 13, Frames".Archived fromthe originalon 30 October 2007.
  4. ^Shafer, Dan (1996).JavaScript & Netscape wizardry.Scottsdale, AZ: Coriolis Group Books. pp.31.ISBN978-1-883577-86-5.
  5. ^"XFrames working draft".W3C.
  6. ^HTML5 differences from HTML4:"The following elements are not in HTML5 because using them damages usability: frame, frameset, noframes"
  7. ^HTML5 differences from HTML4:"The iframe element has new attributes called sandbox and srcdoc which allow for sandbo xing content, e.g. blog comments."
  8. ^"Framesets".
  9. ^Roberts, L, John."CSS and SEO".Retrieved28 January2022.
  10. ^abNielsen, Jakob (December 1996)."Frames Suck Most of the Time".
  11. ^"Should You Use Frames?".HTML Code Tutorial. Archived fromthe originalon 6 August 2016.Retrieved7 April2010.
  12. ^"G.E.Boyd's How To Do Just About Anything by email – Part 1".GeoCities.11 August 2000. Archived fromthe originalon 17 August 2000.Retrieved24 June2010.
  13. ^Moore-Eded, Piers."SEO fundamentals 1".Lewes SEO.Retrieved25 February2012.
  14. ^"I Hate Frames Club".
  15. ^ab"Why are frames so evil?".
  16. ^ab"The Pros and Cons of Frames in Web Pages".

External links[edit]