Results 1 to 3 of 3
  1. #1
    Join Date
    May 2005
    Location
    Billings, MT
    Posts
    2

    Question 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!

  2. #2
    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.

  3. #3
    Join Date
    May 2005
    Location
    Billings, MT
    Posts
    2

    Talking

    Thank you very much, that was it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •