Javascript刷新頁面的幾種方法(未測試):
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
說明一下,jQuery沒有發現刷新頁面的方法。
//網上一篇(未測試) //頁面加載時綁定按鈕點擊事件 $(function(){ $("#按鈕id").click(function(){ refresh(); }); }); //點擊按鈕調用的方法 function refresh(){ window.location.reload();//刷新當前頁面. //或者下方刷新方法 //parent.location.reload()刷新父親對象(用於框架)--需在iframe框架內使用 // opener.location.reload()刷新父窗口對象(用於單開窗口 //top.location.reload()刷新最頂端對象(用於多開窗口) }