Menu

"Undefined value..." Javascript error

Anonymous
2003-06-10
2003-09-23
  • Anonymous

    Anonymous - 2003-06-10

    Hello,

    I get a "The undefined value has no properties" EvaluatorException when I access the following simple html page via HttpUnit. It occurs when I try to update an element's visibility.  I have tried a number of things in both javascript and html, and continue to get the same error.

    I am using 1.5.3 and have gotten the same error running with Tidy.jar and nekohtml/xercesImpl.

    I have not set any ClientProperties - could this be my issue?

    ------------------------------

    <HTML>
    <HEAD>
    <TITLE>Test</TITLE>

    <script language=JavaScript>
    <!--
    function test()
    {
      var divName = "top";
       
      if( document.getElementById )
      {
        // this statement causes the exception
        // there is no error if it is commented out
       document.getElementByID(divName).style.visibility="hidden";
      }
      else if( document.layers )
      {
        document.layers[divName].visibility="hide";
      }
      else if( document.all )
      {
        document.all[divName].style.visibility="hidden";
      }
      else
      {
        alert("Browser detection failed");
      }
    }
    // -->
    </script>

    </head>

    <body onload="test()">

    <div id="top">Hello</div>
    <div id="bot">Dolly</div>

    </BODY>
    </HTML>

     
    • Anonymous

      Anonymous - 2003-09-23

      I've got exactly the same problem :

      document.getElementById(id) is undefined !

       

Log in to post a comment.

Auth0 Logo