为什么每次都会告诉我“缺少对象”阿?:(

解决方案 »

  1.   

    太乱了,改写了一下。先试试
    <?phpinclude "common.inc.php";echo <<< SCRIPT
    <script LANGUAGE=JavaScript>
    with (document)
    {
     write("<STYLE TYPE='text/css'>");
     write(".gen1(visibility:hidden)");
     write("</STYLE>");
    }function initItq(){
      divColl = document.all.tags('DIV');
      for (i=0; i<divColl.length; i++) {
        whichEl = divColl(i);
        if (whichEl.className == 'gen1')
          whichEl.style.visibility = 'hidden';
      }
    }
    SCRIPT;$typeResult1=pg_exec($PG_CONN,"select * from movietype where mtype = '1';");
    $count1=pg_numrows($typeResult1); 
    echo "count1 = $count1;\n";
    echo "var type1=new Array();\n"; 
    for($i=0;$i<$count1;$i++)
    {
       $arrname1=pg_fetch_array($typeResult1,$i);
       $type1[$i] = $arrname1["mname"];  
       echo "type1[$i] ='a$i';\n";
       $tmpname1 = $arrname1["mname"];
       $typeResult12=pg_exec($PG_CONN,"select * from movietype where mtype = '2' and type1 = '$tmpname1';");
       $count12=pg_numrows($typeResult12); 
       $count2[$i] = $count12 ; 
       for($j=0;$j<$count12;$j++)
       {
       $arrname12=pg_fetch_array($typeResult12,$j);
        $type2[$i][$j] = $arrname12["mname"]; 
         }     
    }//function showIt(i)
    echo <<< SCRIPT
    function showIt(i)
    {
    alert('aaa');
      whichE1 = eval('a' + i );
      whichE1.style.visibility == 'show');
      for(j = 0;j<count1 && j<>i;j++)
      {
      whichE1 = eval('a' + j );
      whichE1.style.visibility == 'hidden');
      }
    }function hiddenIt()
    {
      for(j = 0;j<count1;j++)
      {
      whichE1 = eval('a' + j );
      whichE1.style.visibility == 'hidden');
      }
    }onload = initItq;</script>
    SCRIPT;?><body>
    <table width="90%" border="0">
    <tr> 
    <?php
    for ($i=0;$i<$count1;$i++){
      echo <<< TD
    <td onMouseOver="showIt('$i')">$type1[$i]
       <div id='a$i' class="gen1" style="position:absolute; width:113px; height:82px; z-index:1; left: 3px; top: 33px; visibility: hidden;"> 
       <table width="90%" border="0">
    TD;
       for ($j=0;$j<$count2[$i];$j++) {
         echo "<tr><td>{$type2[$i][$j]}</td></tr>";
       }
    echo "
       </table>
       </div>
    </td>";
    }
    ?>
    </tr>
    </table>
    <table width="90%" height="561" border="0">
    <tr>
        <td onMouseOver="hiddenIt()">&nbsp;</td>
    </tr>
    </table>
    </body>
      

  2.   

    还是不行,和原来一样的问题,缺少对象!
      

  3.   

    没有数据如何调试?
    你应该贴出浏览器中的代码。