Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我有来自google sheet的Java脚本数据,如何实现搜索功能并确保50000行加载_Javascript_Search - Fatal编程技术网

Javascript 我有来自google sheet的Java脚本数据,如何实现搜索功能并确保50000行加载

Javascript 我有来自google sheet的Java脚本数据,如何实现搜索功能并确保50000行加载,javascript,search,Javascript,Search,我正在寻找一个脚本巫婆能够搜索从html谷歌表表。 如果有大量数据,它必须加载数据或拆分数据 <p class="font-weight-bold">The data in the table comes from the google spreadsheet</p> <a class="btn btn-primary mb-4" href="https://docs.google.com/spreadsheets/d/1t2_HHLkibAybPORmXuDDE

我正在寻找一个脚本巫婆能够搜索从html谷歌表表。 如果有大量数据,它必须加载数据或拆分数据

<p class="font-weight-bold">The data in the table comes from the google spreadsheet</p>

<a class="btn btn-primary mb-4" href="https://docs.google.com/spreadsheets/d/1t2_HHLkibAybPORmXuDDEFEyetC3p7r1blQRpjzinXg/edit?usp=sharing" role="button" target="_blank">Click to see the source sheet</a>

<!-- Table  -->
<table class="table table bordered table-striped" id="testTable">
  <!-- Table head -->
  <thead>
    <tr>
      <th>Name</th>
      <th>Age</th>
      <th>E-mail</th>
    </tr>
  </thead>
  <!-- Table head -->

  <!-- Table body -->
  <tbody id="demo">


  </tbody>
  <!-- Table body -->
</table>
<!-- Table  -->


这个结果是我想要得到的:

您可以像这样为表添加搜索、分页和排序: $‘表ID’。数据表; $'.dataTables_length'.addClass'bs-select'

下面是带有搜索功能的示例

$.getJSONhttps://spreadsheets.google.com/feeds/list/1t2_HHLkibAybPORmXuDDEFEyetC3p7r1blQRpjzinXg/od6/public/values?alt=json,函数数据{ var sheetData=data.feed.entry; var i; 对于i=0;i表格中的数据来自谷歌电子表格

名称 年龄 电子邮件
<script>
 $.getJSON("https://spreadsheets.google.com/feeds/list/1t2_HHLkibAybPORmXuDDEFEyetC3p7r1blQRpjzinXg/od6/public/values?alt=json", function (data) {

      var sheetData = data.feed.entry;

      var i;
      for (i = 0; i < sheetData.length; i++) {

        var name = data.feed.entry[i]['gsx$_cn6ca']['$t'];
        var age = data.feed.entry[i]['gsx$_cokwr']['$t'];
        var email = data.feed.entry[i]['gsx$_cpzh4']['$t'];

        document.getElementById('demo').innerHTML += ('<tr>'+'<td>'+name+'</td>'+'<td>'+age+'</td>'+'<td>'+email+'</td>'+'</tr>');

      }
    });

</script>