window.onload = setupRefresh;
function setupRefresh() {
setInterval("refreshBlock();", 1000);
}
function refreshBlock() {
$('#activeItems').load("current_auctions.php");
}
上面的代码每 1 秒自动刷新我页面上 div 标签的内容。
window.onload = setupRefresh;
function setupRefresh() {
setInterval("refreshBlock();", 1000);
}
function refreshBlock() {
if ($('#myAccount').html() == 'My Accout') {
$('#activeItems').load("current_auctions.php");
};
}
上面的代码,只添加了一个 if 语句,在开始时加载了一次页面,然后停止刷新。如何修复此代码?