TOC PREV NEXT INDEX

domref


DOM Frame Reference

This document contains reference information for the following DOM objects:

FRAMESET


The FRAMESET element is a structure for containing subframes in HTML. It manages FRAME elements but not IFRAMES, which are inserted "in-line" into the document. In HTML, a frameset takes the following basic structure:

<frameset>
 
  <frame src="some_doc.html" id="frame1" />
 
  <frame src="other_doc.html" />
 
</frameset>
 

The DOM frameset object provides minimal programmatic access to the FRAMESET HTML element. Its interface-the two optional properties cols and rows-are a way to indicate the dimensions of the frame set, how many subframes it manages. Note that the frameset object does not provide interfaces for getting to the subframes it manages.

To get the frames in a document, you must ask the document itself, using the document.getElementById() method and the id of the frame(s) you want, or the document.getElementsByTagName("FRAME"), which returns a NamedNodeList array:

f1 = document.getElementById("frame1");
 
alert(f1.src); // print the src of the first frame
 

 
frames = document.getElementsByTagName("FRAME");
 
for (var i = 0; i < frames.length; i++) {
 
  // do something with each frame as frames[i]
 

 
}
 

 

Properties

This property sets or returns the size of the columns of frames in the frameset..
This property sets or returns the number of rows of frames in the frameset.


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX