一直在寻找答案,但没有找到。我有一个代码,它显示一个基于参数“rg1”从服务器端 genqueuesearch.php 中提取的表。每行都有一个名为 Queue 的列,其中包含一个“rg1”字符串。该表有几列,但我的挑战是只显示 4 列。这是我的 AJAX 代码:
<html>
<head>
<script language="Javascript">
   function View(){
   ...
      xmlhttp.onreadystatechange=function(){
         if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById("datatable").innerHTML=xmlhttp.responseText;    
         }
      }
      var parameters = "search="+"rg1";
      xmlhttp.open("POST", "http://drcsblr0165/genqueuesearch.php", true);
      xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      xmlhttp.send(parameters); 
   }
</script>
</head>
   <body onload="View()">
      <div id="datatable" align="center"></div>
   </body>
</html>
试过 getElementsbyTagName 但我不知道我想要的列的标签名称。这是否需要先将表格保存到文本文件?感谢您的所有帮助,如果我不清楚,请询问。