I've been googling for days and found plenty of examples, none of them appear to work though.
Below are three windows of text that I've been using to test the idea: the first is the frameset, the second is the frame content, the third is the javascript. I'm testing on Firefox 3.
Can anyone tell me what it is that I am doing wrong?
FramesetPractice.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<frameset cols="50,50" rows="50,50" id="TestFrameset">
<frame name="TopLeft" src="FramedPagePractice.html" />
<frame name="TopRight" src="FramedPagePractice.html"/>
<frame name="BottomLeft" src="FramedPagePractice.html"/>
<frame name="BottomRight" src="FramedPagePractice.html"/>
</frameset>
</html>
FramedPagePractice.html
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" language="javascript" src="FramesPractice.<acronym title="JavaScript"><acronym title="JavaScript">js</acronym></acronym>" ></script>
</head>
<body>
<form>
<input type="text" name="DisplayText"/>
<br />
<input type="button" name="CommandButton" value="Click Me!" onClick="OnlyFunction()"/>
</form>
</body>
</html>
FramesPractice.<acronym title="JavaScript"><acronym title="JavaScript">
js</acronym></acronym>
Code:
function OnlyFunction (){
alert(top.frames[0].name);
top.getElementById("TestFrameset").rows = "20%,80%";
}