1. 程式人生 > >js常用刷新頁面的操作

js常用刷新頁面的操作

自動刷新 meta his http navi cati 自動 href 一次

一、手動刷新

1,history.go(0)
2,location.reload()
3,location=location
4,location.assign(location)
5,document.execCommand(‘Refresh‘)
6,window.navigate(location)
7,location.replace(location)
8,document.URL=location.href

二、自動刷新

<meta http-equiv="refresh" content="20">

每20秒刷新一次

三、頁面自動跳轉

<meta http-equiv="refresh" content="20;url=http://www.baidu.net">

20秒後,在跳轉值www.baidu.com

js常用刷新頁面的操作