Output a frameset through document.write : frameset « HTML Tags « JavaScript Tutorial






<html>
<head>
<script language="JavaScript" type = "text/javascript">
<!--
var frame_URL;
if (location.search)
{
    frame_URL = location.search.substring(1);
}
else {
     frame_URL = "http://www.java2s.com";
}

{
 document.write("<frameset rows = '20%, 80%'>")
 document.write("  <frame src='http://www.java2s.com'>")
 document.write("<frame src='" + frame_URL + "'>")
 document.write("  </frameset>")
}
//-->
</script>
</head>
<body>
</body>
</html>








21.8.frameset
21.8.1.Output a frameset through document.write
21.8.2.Change frame location(URL)
21.8.3.Reference the top frame
21.8.4.Reference the parent frame
21.8.5.Nested framesets
21.8.6.Change two frames in a frame set
21.8.7.Reference element in frameset