求助`
加了这句<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">JS无法在火狐下动作...在IE和腾迅TT下确能动作`  <table width="100%" height="35" border="0" cellpadding="2" cellspacing="0">
  
                          <tr> 
                            <td width="75" align="center"><font color="#999999">1111</font></td>
                            <td width="305"><a href="javascript:ActLayerQA('viewQA_1');">问</a></td>
                            <td width="100" align="center"><font color="#999999">信江数码</font></td>
                            <td align="center"><font color="#999999">2009-8-31</font></td>                          </tr>
                          </table>
                        <div id="viewQA_1" style=display:none > 
                          <table width="100%" height="35" border="0" cellpadding="2" cellspacing="0" bgcolor="#F5F5F5">
                            <tr> 
                              <td width="20">&nbsp;</td>
                              <td>www.byxj.cn 网购手机我选择信江数码</td>
                              <td width="20">&nbsp;</td>
                            </tr>                          </table>
                        </div><script>
function ActLayerQA(pIdx) {
if (document.all[pIdx].style.display == "none") {
             for (var i=1; i<2; i++){
                         document.all["viewQA_"+i].style.display = "none";
                }
document.all[pIdx].style.display = "block"; 
} else {
document.all[pIdx].style.display = "none";
}
 }  
</script>
高手门`帮帮我解达谢谢`我没多少分`..只能拿出剩余的分

解决方案 »

  1.   

    把document.all[pIdx] 换成 document.getElementById(pIdx)
      

  2.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
    <html>
    <body><table width="100%" height="35" border="0" cellpadding="2" cellspacing="0"> 
      
                              <tr> 
                                <td width="75" align="center"> <font color="#999999">1111 </font> </td> 
                                <td width="305"> <a href="javascript:ActLayerQA('viewQA_1');">问 </a> </td> 
                                <td width="100" align="center"> <font color="#999999">信江数码 </font> </td> 
                                <td align="center"> <font color="#999999">2009-8-31 </font> </td>                           </tr> 
                              </table> 
                            <div id="viewQA_1" style=display:none > 
                              <table width="100%" height="35" border="0" cellpadding="2" cellspacing="0" bgcolor="#F5F5F5"> 
                                <tr> 
                                  <td width="20">&nbsp; </td> 
                                  <td>www.byxj.cn 网购手机我选择信江数码 </td> 
                                  <td width="20">&nbsp; </td> 
                                </tr>                           </table> 
                            </div> <script> 
    function ActLayerQA(pIdx) { 
    if (document.getElementById(pIdx).style.display == "none") { 
                for (var i=1; i <2; i++){ 
                            document.getElementById("viewQA_"+i).style.display = "none"; 
                    } 
    document.getElementById(pIdx).style.display = "block"; 
    } else { 
    document.getElementById(pIdx).style.display = "none"; 

    }  
    </script> 
    </body></html>
      

  3.   

    果然强啊``大哥`~~看别人的帖子以为只是eval 才要用那个getElementById替换``大哥们再帮帮小的``同样是这个问题加了
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    无法在火狐下动作JS<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <a onClick=javascript:ShowFLT(1) href="javascript:void(null)">信江数码</a>
    <div id=LM1 style="DISPLAY: none" bgcolor="#F5F5F5" >
    www.byxj.cn网购我选择信江数码!
    </div>
    <script>
    var number= '1'; //定义条目数function LMYC() {
    var lbmc;
        for (i=1;i<=number;i++) {
            lbmc = eval('LM' + i);
            lbmc.style.display = 'none';
        }
    }
     
    function ShowFLT(i) {
        lbmc = eval('LM' + i);
        if (lbmc.style.display == 'none') {
            LMYC();
            lbmc.style.display = '';
        }
        else {
            lbmc.style.display = 'none';
        }
    }
    </script>
      

  4.   

    上面这段代码lbmc = eval('LM' + i); 改成  lbmc = getElementById('LM' + i); 成了无法动作..在IE和火狐下都没反应了`.高手门再帮帮我啊`谢谢
      

  5.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    无法在火狐下动作JS 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <a onClick=javascript:ShowFLT(1) href="javascript:void(null)">信江数码 </a> 
    <div id=LM1 style="DISPLAY: none" bgcolor="#F5F5F5" > 
    www.byxj.cn网购我选择信江数码! 
    </div> 
    <script> 
    var number= '1'; //定义条目数 function LMYC() { 
    var lbmc; 
        for (i=1;i <=number;i++) { 
            lbmc = document.getElementById('LM' + i); 
            lbmc.style.display = 'none'; 
        } 
    } function ShowFLT(i) { 
        lbmc = document.getElementById('LM' + i); 
        if (lbmc.style.display == 'none') { 
            LMYC(); 
            lbmc.style.display = ''; 
        } 
        else { 
            lbmc.style.display = 'none'; 
        } 

    </script>can view.
      

  6.   

    我搞不明`为什么你们个个都能弄得出`.我尝试过像楼上这样子`直接把`lbmc = eval('LM' + i); 改成  lbmc = getElementById('LM' + i); 但是却没反应``你们都很强!!!!
      

  7.   

    我明白了`原来我漏了"document."楼上的都很强..谢谢``