基本上我有一個動態HTML表格對於特定的URL每5秒刷新一次表格
<table id="example"></table>
。
表中的內容根據URL更改。我默認 URL將
index.php?action=add
爲此,我寫了一個函數來刷新我的表,每隔5秒鐘,工作正常
var autoLoad = setInterval(
function()
{
$('#example').load('index.php?action=add #example').fadeIn("slow");
}, 5000);
然後i'l我的網址更改爲
index.php?action=add&subdo=loc
。
這將改變我的HTML表格內的內容。
讓我怎麼刷新我的HTML表格每5秒的新內容爲index.php?action=add&subdo=loc
編輯:我將不得不改變對多個URL對我的表中對不同URL的不同內容。沒有一個
index.php?action=add&subdo=loc1
index.php?action=add&subdo=loc2
當你說你是什麼意思_ 「然後i'l改變我的網址爲」 _?你在什麼時候改變它的目的是什麼? – 2015-02-11 11:40:56
您可以使用setInterval或在瀏覽器中每5秒鐘按F5鍵。 – 2015-02-11 11:52:49