Results 1 to 3 of 3
-
05-25-2005, 12:19 PM #1New Member
- Join Date
- May 2005
- Location
- Billings, MT
- Posts
- 2
javascript function has no properties in javascript console
'm getting errors in Firefox everytime I try to run this frame resize code, but it works fine in IE. I can't seem to figure out what the problem is with it.
The error is: Error: theFrame has no properties
Line: 8
The line that the javascript console is showing an error for is in italics.
code from page:
<html>
<head>
<script type="text/javascript">
var defaultCols="100px,*";
var hiddenCols="0px,*";
function ShowHideMenu(){
theFrame = document.getElementById("framed");
if(theFrame.cols == defaultCols) theFrame.cols=hiddenCols;
else theFrame.cols=defaultCols;
}
</script>
<frameset cols="100px,*" name="framed">
<frame src="lframe.htm" name="frameMenu">
<frame src="mframe.htm" name="content">
</frameset>
</head>
<body>
</body></html>
Come someone let me know what I'm doing wrong here?
Thanks to everyone for all of your help in advance!
-
05-25-2005, 01:05 PM #2Newbie
- Join Date
- Oct 2002
- Posts
- 23
Hi mrblack,
document.getElementById() needs an ID on the element.
For example:
document.getElementByid('framed') will take the id 'framed'.
<frameset cols="100px,*" name="framed" id="framed">
I think it will work.
-
05-25-2005, 02:15 PM #3New Member
- Join Date
- May 2005
- Location
- Billings, MT
- Posts
- 2
Thank you very much, that was it!