首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

onclick事件在firefox中失效解决思路

2012-06-01 
onclick事件在firefox中失效页面如下在IE中可以执行,在FireFox中执行不了,要怎么修改一下。C# codePage Lan

onclick事件在firefox中失效
页面如下 在IE中可以执行,在FireFox中执行不了,要怎么修改一下。

C# code
Page Language="C#" AutoEventWireup="true" CodeFile="Tab.aspx.cs" Inherits="Tab" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>无标题页</title>            <link href="css/css.css" rel="stylesheet" type="text/css"></head><body>    <form id="form1" runat="server">    <div id="Center">    <table width="400" border="0" cellpadding="0" cellspacing="0" class="solid-bottom">  <tr>    <td width="383" height="19"><table  border="0"  cellpadding="0"  cellspacing="0"  id="secTable">      <tr>        <td  width="70" align="center"  class="sec2"  onclick="secBoard(0)" style="height: 17px">工艺技术</td>        <td  width="120" align="center"  class="sec1"  onclick="secBoard(1)" style="height: 17px">生产制造</td>        <td  width="110" align="center"  class="sec1"  onclick="secBoard(2)" style="height: 17px">设计服务</td>        <td  width="110" align="center"  class="sec1"  onclick="secBoard(3)" style="height: 17px">人力资源</td>      </tr>    </table></td>    <td width="17"><script  language="JavaScript" type="text/javascript">function  secBoard(n){for(i=0;i<secTable.cells.length;i++)secTable.cells[i].className="sec1";secTable.cells[n].className="sec2";for(i=0;i<mainTable.tBodies.length;i++)mainTable.tBodies[i].style.display="none";mainTable.tBodies[n].style.display="block";}</script></td>  </tr></table><table  border="0"  cellspacing="5"  cellpadding="0"  width="400"  height="120"  id="mainTable">  <tbody  style="display:block;">    <tr>      <td height="120"><table width="100%" border="0" cellspacing="0" cellpadding="0">        <tr>          <td height="72"><img src="images/ASDF.jpg" width="180" height="41" align="left" />ASDF 是一个小巧的 ICO/PNG 互转小工具,有了它你就不用再打开庞大的 Axialis IconWorkshop   了,而且它界面超简洁,只需拖动图片到窗口中再拖动回来,整个转换过程就算完成了。 </td>        </tr>        <tr>          <td height="22" align="right"><a href="AA" target="_blank">立刻下载 ASDF</a></td>        </tr>      </table></td>    </tr>  </tbody>  <tbody  style="display:none;">    <tr>      <td height="120"><table width="100%" border="0" cellspacing="0" cellpadding="0">        <tr>          <td height="72"><img src="images/SWFDecompiler_icon.jpg" width="51" height="53" align="right" />用于浏览和解析Flash动画.swf文件的工具。它能够将flash动画中的图片、矢量图、字体、文字、按钮、影片片段、帧等基本元素完全分解,还可以对flash影片动作Action进行解析,清楚的显示其动作的代码,让您对Flash动画的构造一目了然。</td>        </tr>        <tr>          <td height="22" align="right"><a href="AA" target="_blank">下载 SWF_Decompiler</a></td>        </tr>      </table></td>    </tr>  </tbody>  <tbody  style="display:none;">    <tr>      <td height="120"><table width="100%" border="0" cellspacing="0" cellpadding="0">        <tr>          <td height="72"><img src="images/FlashCatcher.jpg" width="180" height="40" align="left" />您在浏览网页的时候,有没有为了保存一个喜欢的Flash而不知所措呢?别急,这个小软件可以让您轻而易举地将页面中的Flash给抓出来,保存Flash就这么简单。</td>        </tr>        <tr>          <td height="22" align="right"><a href="AA" target="_blank">下载 FlashCatcher</a></td>        </tr>      </table></td>    </tr>  </tbody>    <tbody  style="display:none;">    <tr>      <td height="120"><table width="100%" border="0" cellspacing="0" cellpadding="0">        <tr>          <td height="72"><img src="images/ASDF.jpg" width="180" height="41" align="left" />ASDF 是一个小巧的 ICO/PNG 互转小工具,有了它你就不用再打开庞大的 Axialis IconWorkshop   了,而且它界面超简洁,只需拖动图片到窗口中再拖动回来,整个转换过程就算完成了。 </td>        </tr>        <tr>          <td height="22" align="right"><a href="AA" target="_blank">立刻下载 ASDF</a></td>        </tr>      </table></td>    </tr>  </tbody>    <tbody  style="display:none;">  </tbody></table><p></p><p></p><p><br></p>    </div>    </form></body></html> 



[解决办法]
secTable>>document.getElementById('secTable')试试
[解决办法]
html代码太烂。td中直接嵌套tr,严重不符合规范。
[解决办法]
cells不是一个table对象的w3c标准集合,建议从rows遍历吧。

热点排行
Bad Request.