document.write('<tr><td BGCOLOR=\'#0099FF\' height=20  bgcolor=white onclick="navigateie('+i+')" onmouseover="className=\'h1\'" onmouseout="className\'n\'" ><center>'+text[i]+'</center></td></tr>'); 这里用JS产生HTML的,
上面这段代码里,当你在表格的单元格单击时就会触发那个事件函数

解决方案 »

  1.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>&ordm;ó &Igrave;¨ &sup1;&Uuml; &Agrave;í</title>
    <script language="javascript1.2">
    function move(x)
    {
    if (document.all)
    {
    object1.style.pixelLeft += x;
    object1.style.visibility = "visible";
    }
    else //if(document.layers)
    {
    document.object1.left += x;
    document.object1.visibility = "show";
    }
    }function makeStatic()
    {
    if (document.all)
    {
    object1.style.pixelTop=document.body.scrollTop+20;
    }
    else
    {
    eval(document.object1.top =eval(window.pageYoffset+20));
    }
    setTimeout("makeStatic()",0);
    }</script>
    <style>
    <!--
    {
    Background-Color : yellow;
    }
    -->
    </style>
    </head><body>
    <LAYER name="object1" left="50" top="150" width="150" height="100" bgcolor="black" onmouseover="move(230)" onmouseout="move(-230)" visisbility="hide"> 
    <!--<LAYER name="object1" left="55" top="38" width="141" height="86" bgcolor="black" onclick="move(100)" visisbility="hide"> 
    -->
    <script language="javascript1.2">
    function positionmenu()
    {
    //move(-230);
    move(-230);
    }
    if (document.all)  //IE
    {
    document.write('<div id="object1" style="visibility:hidden;cursor:hand;position:absolute; width:200px; height:115px; z-index:20; left: 0px; top: 20px;" onmouseover="move(230)" onmouseout="move(-230)">');
    }
    </script>
    <table width="256" border="1">
      <tr>
        <td width="246" BGCOLOR='#0099FF'><font size="4" face="Arial, Helvetica, sans-serif"><center><b>&ordm;ó&Igrave;¨&sup1;&Uuml;&Agrave;í</b></center></font></td>
    <!--    <td >&nbsp;</td>  -->
    <script language="javascript1.2">document.write('<td align="center" rowspan="100" width="16" bgcolor="#FF6666"><span style="font-size:13px"><p align="center"><font face="Arial, Helvetica, sans-serif">M<BR>E<BR>N<BR>U</font></p></span></td>');
    </script>&nbsp;

      </tr>
      <script language="JavaScript1.2">
    <!--
    if (document.all||document.layers)
    {
    makeStatic();
    }var text=new Array();
    var thelink=new Array();
    text[0]="&Ocirc;&ouml; &frac14;&Oacute; &Agrave;à ±&eth;";
    text[1]="&ETH;&THORN; &cedil;&Auml; &Agrave;à ±&eth;";
    text[2]="&Iuml;&Ocirc; &Ecirc;&frac34; &Agrave;à ±&eth;";
    text[3]="&Ocirc;&ouml; &frac14;&Oacute; &ETH;&iexcl; &Agrave;à ±&eth;";
    text[4]="&ETH;&THORN; &cedil;&Auml; &ETH;&iexcl; &Agrave;à ±&eth;";
    text[5]="&Iuml;&Ocirc; &Ecirc;&frac34; &ETH;&iexcl; &Agrave;à ±&eth;";
    thelink[0]="Type_Add.php";
    thelink[1]="Type_Alter.php ";
    thelink[2]="Show_Type.php";
    thelink[3]="Ltype_Add.php";
    thelink[4]="Ltype_Alter.php";
    thelink[5]="Ltype_show.php";
    var linktarget='';
    function navigateie(which)
    {
    if (linktarget=='')
    window.location=thelink[which]
    else if(linktarget=='new')
    window.open(thelink[which])
    else
    {
    temp_var=eval("window.parent."+linktarget)
    temp_var.location=thelink[which]
    }
    }
    for(i=0;i<=text.length-1;i++){
    if (document.all)
    {
    document.write('<tr ><td BGCOLOR=\'#0099FF\' height=20  bgcolor=white onclick="navigateie(\''+i+'\')\" onmouseover=\"this.className=\'h1\'\" onmouseout=\"this.className=\'n\'\" ><center>'+text[i]+'</center></td></tr>');
    }
    else
    {
    //document.write('<tr><td onclick="navigateie('+i+')" onmouseover="className=\'h1\'" onmouseout="className\'n\'" >'+text[i]+'</td></tr>');
    //document.write('<tr><td >ss</td></tr>');

    }
    }
    //-->
    </script> 
      
      <tr>
        <td bgcolor="#0099FF"><font size="+1" face="Arial, Helvetica, sans-serif">&nbsp;</font>&nbsp;</td>
      
      </tr>
    </table>
    <script language="javascript1.2">
    if(document.all)
    {
    document.write('</div>');
    }
    else{
    document.write('</layer>');
    }
    window.onload=positionmenu;</script>
    </body>
    </html>