This page is Not Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

frame

Summary

The frame element (<frame>) defines one particular window (frame) within a <frameSet>. The <frame> element is obsolete in HTML5.

Overview Table

DOM Interface
HTMLFrameElement

Examples

This example uses the frame element to define properties of the frame, including the location of the page loaded by the frame.

<frame frameborder=0 scrolling="no" src="sample.htm">

This example shows how to reference an object withID=sID in FRAME2, from another frame of the same frameset.

parent.frames.FRAME2.sID.innertext

Notes

Remarks

You can access the frame object’s properties (but not its contents) through the object model of the page in which the frame object resides. For example, the syntax for accessing the border style of the frame object is:

sBorderValue = document.all.oFrame.style.border;

If a user opens a Web folder inside a frame and then clicks something in the Web folder, the file or folder that the user clicks takes over the entire window. For example, suppose that a page contains two frames, one frame pointing to http://www.microsoft.com and the second frame pointing to a network drive. If the user clicks a file or folder in the second frame, that frame takes control of the entire window, including the first frame. For file types that the browser cannot host, such as .txt files, a separate window in the appropriate host application is opened. A Web folder is a part of the file system hierarchy, but it does not necessarily represent anything in the file system. An example is Network Neighborhood.

**Security Warning: ** To protect user privacy and safeguard your applications, Windows Internet Explorer restricts some interactions between frames that host Web pages from different domains. For more information about using the Dynamic HTML (DHTML) object model with the frame and iframe objects, see About Cross-Frame Scripting and Security and Security Considerations: Dynamic HTML. Windows Internet Explorer 8 and later. The values of the longDesc and src attributes depend on the current document compatibility mode. Windows Internet Explorer 7 and later. For security reasons, resizing is disabled for frame objects that display content hosted on a domain different from the domain hosting the parent document. If you trust the content you are loading into an frame object, you can enable resizing by specifying values for the minWidth and maxWidth attributes of the frame element in the source of the parent document. You must specify values for both attributes to enable resizing. Microsoft Internet Explorer 5.5 supports transparent content for a frame. The following conditions must be met to define transparent content for a frame.

  1. The allowTransparency attribute, used with the frame element, must be set to VARIANT_TRUE.
  2. In the frame content source document, the backgroundColor or bgColor attribute of the body element must be set to transparent.

See also

Related pages

  • frameSet

Attributions