强制刷新

// 从服务器重新加载(绕过缓存)
location.reload(true); 
 
// 现代浏览器推荐写法(等效于 F5 刷新)
window.location.reload({ 
  cache: 'reload', 
  mode: 'same-origin' 
});

无痕刷新​

location.replace(location.href);

定时器方案​

// 精准控制刷新逻辑
let refreshController = new AbortController();
 
setTimeout(() => {
  location.reload();
  refreshController.abort(); // 可取消刷新
}, 10000, { signal: refreshController.signal });

iframe

// 父窗口刷新子 iframe
parent.document.getElementById('frameId').contentWindow.location.reload();
 
// 子 iframe 刷新父窗口
window.opener.location.reload();