0
我有這段代碼,它從Google Spreadsheet生成一個HTML表格。我試圖使僅在表格自動刷新每5秒,而電子表格加載。但是,使用下面的代碼時,只會讓表格在5秒後消失。有人看到有什麼錯誤或有更好的解決方案嗎?自動重新加載HTML表格只是讓它消失
<div class="sheetstotables"></div>
<script type="text/javascript">
var tableId = "AB12C"
var x = document.createElement("script"); x.type = "text/javascript"; x.async = true;
x.src = "http://www.sheetstotables.com/get_table.js";
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(x, s);
</script>
<script>
function autoRefresh_div()
{
$(".sheetstotables").load("load.html");// a function which will load data from other file after x seconds
}
setInterval('autoRefresh_div()', 5000); // refresh div after 5 secs
</script>
使用F12中的「網絡」選項卡,查看返回的數據。 – maowtm
什麼是F12?你的意思是在鍵盤上......我正在使用一個mac,其中F12只是彈出鍵。 –
無論您使用哪種瀏覽器,都會有一個選項稱爲**開發人員工具**,只需檢查您是否收到任何錯誤或通過** http響應接收了哪些數據** – Rayon