Hi,

I'm trying to configure a nested frameset within an Iframe. I'm not sure if it's possible but maybe someone can help me out...

<iframe src="Home.jsp" allowTransparency="true" width="770" height="580" frameborder="0">
                        <frameset cols="10%, *" border="0">
                            <frame name="leftFrame" src="Black.html" />
                            <frame name="rightFrame" src="White.html" />
                        </frameset>
                    </iframe>

With this code; either there is no frameset being created or the src links are not appearing in the frameset.

Remember that frameset should not use <body> and </body> tag.

Example:

<html>

<frameset cols="25%,*,25%">
  <frame src="frame_a.htm" />
  <frame src="frame_b.htm" />
  <frame src="frame_c.htm" />
</frameset>

</html>

Hi Ashton,

here's a valid frameset document, that you can use when you are creating framed pages in your site:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="#css_level21" media="screen"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html id="xhtml10F" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Window-Target" content="_top" />
<meta http-equiv="imagetoolbar" content="0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>Frameset Template Sample : XHTML 1.0 Frameset-DTD</title>
</head>
<frameset id="MainFrame" cols="50%, 50%">

<!-- LEFT FRAME -->
<frame id="FrameLeft" name="FrameLeft" scrolling="no" marginwidth="1" marginheight="5" src="./left.html" />

<!-- RIGHT FRAME -->
<frame id="FrameRight" name="FrameRight" scrolling="no" marginwidth="1" marginheight="5" src="./right.html" />

<noframes>
<body>
<p>This site requires a browser that support frames.</p>
</body>
</noframes>
</frameset>
</html>

Hi,

Thanks for your input.

Do you have a template for a page that is not affected by resolution differences by any chance? I'm using an Iframe with a nested frameset at the moment to avoid the scrolling issue that comes along with resolution changes...

Thanks..

Hi Ashton,

i am not sure if this is what you need. But this might help you out to set specific width and height over your frame elements:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="#css_level21" media="screen"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html id="xhtml10F" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Window-Target" content="_top" />
<meta http-equiv="imagetoolbar" content="0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<title>Frameset Template Sample : XHTML 1.0 Frameset-DTD</title>
<script language="JavaScript" type="text/javascript">
// <![CDATA[

onload = function() { // @ window.onload - initiating onload event

   var leftFrame = 30; // @ leftWidth - specify the width of the left frame by percentage % value

   var rightFrame = 70; // @ rightWidth - specify the width of the right frame by percentage % value
   var fixRes = ( function( wl, wr ) { // @ fixRes() - function name
   var xWidth = (( xWidth = document.body.scrollWidth ) ? xWidth : xWidth = document.documentElement.scrollWidth ); // @ xWidth - getting the total amount of scrollable ( width in pixel ) area in the document body.

   var xHeight = (( xHeight = document.body.scrollHeight ) ? xHeight : xHeight = document.documentElement.scrollHeight ); // @ xHeight - getting the total amount of scrollable ( height in pixel ) area in the document body. 

   var mainFrame = (( mainFrame = document.getElementById("MainFrame" )) ? mainFrame : mainFrame = document.all.MainFrame ); // @ mainFrame - parent element that holds the entire frameset collection.

   var framed = frames || 0; // @ framed - frame elements

   var fLen = framed.length || 0; // @ fLen - numbers of frames in the document.

   var frame = new Array( fLen ); // @ frame[ index[/color ] - specifying array length - equals to number of available frames in the page

      if ( fLen ) {
         for ( i = 0; !!( framed[ i ] ); i++ ) { // @ i - if it is a valid frame length, continue incrementing ( i ) variable.

/* 1st stage processing: 
 * see which method is supported in the browser:
  @ getElementById - ( modern browsers )

  @ document.all - ( older versions of IE ) */
         (( frame[ i ] = document.getElementById( String( "frame" + i ))) ? frame[ i ] : frame[ i ] = document.all[ String( "frame" + i ) ] );

/* 2nd stage processing:
 * see which properties is supported by this methods.

 @ contentDocument - content document of the frame ( this might not be supported in the frame element )

 @ contentWindow - content document of the frame window ( this might not be supported in the frame element ) */
         (( frame[ i ] = frame[ i ].contentDocument ) ? frame[ i ] : (( frame[ i ] = frame[ i ].contentDocument ) ? frame[ i ] : frame[ i ] ));

/* 3rd stage processing:
 * reassigning its value to hold the actual body element of the frame.

 @ document.body - for IE6-
 @ document.documentElement - IE7+, also supported by all major browsers' */
         (( frame[ i ] = frame[ i ].document.body ) ? frame[ i ] : frame[ i ] = document.documentElement );
         frame[ i ].style.height = xHeight + "px"; // @ frame[ i ] -> xHeight - assigning absolute height over the frame elements.
         } 
      frame[ 0 ].style.width = (( xWidth * leftFrame ) / 100 ) + "px"; // @ frame[ 0 ] - specifying the left-frame width in pixel

      frame[ 1 ].style.width = (( xWidth * rightFrame ) / 100 ) + "px"; // @ frame[ 1 ] - specifying the right-frame width in pixel
      return;
      } alert( "failed to initiate width and height in the frame elements" );
   return false;
   } )( leftFrame, rightFrame );
}
// ]]>
</script>
</head>
<frameset id="MainFrame" cols="*,*">

<!-- LEFT FRAME -->
<frame id="frame0" name="frame0" scrolling="no" marginwidth="0" marginheight="0" src="./left.html" />

<!-- RIGHT FRAME -->
<frame id="frame1" name="frame1" scrolling="no" marginwidth="0" marginheight="0" src="./right.html" />

<noframes>
<body>
<p>This site requires a browser that support frames.</p>
</body>
</noframes>
</frameset>
</html>

-essential

Oh, im so sorry if i have provided you with a wrong example.

But if you could provide me with a detailed pointers, maybe i would be able to work things out and provide you with another code sample.

-essential

This article has been dead for over six months. Start a new discussion instead.