建议使用 childNodes 去访问

解决方案 »

  1.   

    if (curindex % PerRowCount == 1 && typeof(GroupTB.rows[tmp]) == "undefined")
    以上代码在ie7.0正常运行。以下代码在ie8.0 beta1错误<!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>
        <script language="javascript" >
           function test()
       {
          var e = document.getElementById('groupListTB');
      alert(e.rows);//此行ie8.0错误,错误就是意外访问,去掉文件第一行的声明就OK可以,但是同样的在firefox下可以正常执行
       }
        </script>
    </head>
    <body>
        <div id="groupListDiv" width="100%">
                <table id="groupListTB" width="100%">
      <tr>
      </tr>
      <tr>
      </tr>
                </table>
            </div>
    <input type="button" value="click me" onclick="test();">
    </body>
    </html>