Java Reference
In-Depth Information
<head>
<title>Chapter 8: Example 3 Page A</title>
<script type=”text/javascript”>
function btnShowVisited_onclick()
{
document.form1.txtaPagesVisited.value =
window.top.returnPagesVisited();
}
function setFrameAndPageControls(linkIndex)
{
var formobject = window.parent.parent.frameMenu.document.form1;
formobject.choosePage.selectedIndex = linkIndex;
if (window.parent.frameTop == window.self)
{
formobject.radFrame[0].checked = true;
}
else
{
formobject.radFrame[1].checked = true;
}
return true;
}
</script>
</head>
<body onload=”window.top.addPage(window.location.href)”>
<h2>This is Page A</h2>
<p>
<a href=”ch08_examp3_a.htm” name=”pageALink”
onclick=”return setFrameAndPageControls(0)”>Page A</a>
<a href=”ch08_examp3_b.htm” name=”pageBLink”
onclick=”return setFrameAndPageControls(1)”>Page B</a>
<a href=”ch08_examp3_c.htm” name=”pageCLink”
onclick=”return setFrameAndPageControls(2)”>Page C</a>
<a href=”ch08_examp3_d.htm” name=”pageDLink”
onclick=”return setFrameAndPageControls(3)”>Page D</a>
</p>
<form name=”form1” action=”“>
<textarea rows=”10” cols=”35” name=”txtaPagesVisited”></textarea>
<br />
<input type=”button” value=”List Pages Visited” name=”btnShowVisited”
onclick=”btnShowVisited_onclick()” />
</form>
</body>
</html>
Save the pages as ch08_examp3_a.htm , ch08_examp3_b.htm , ch08_examp3_c.htm , and
ch08_examp3_d.htm .
Load ch08_examp3.htm into your browser, and you'll see a screen similar to the one shown in
Figure 8-7.
Search WWH ::




Custom Search