十二
17
自动刷新
HTML自动刷新:<meta http-equiv=“refresh” content=“20″> 其中20指每隔20秒刷新一次页面
HTML自动跳转:<meta http-equiv=“refresh” content=“20;url=http://www.qq.com”> 其中20指隔20秒后跳转到http://www.qq.com页面
Javascript利用timer自动刷新:
function myrefresh() {
window.location.reload();
}
setTimeout(’myrefresh()’,1000); //指定1秒刷新一次
Javascript刷新页面
- window.location.reload();
- window.history.go(0); //可保持滚动条位置
- document.execCommand(’Refresh’);
- window.location.href=location.href; //在弹出新窗口刷新依然有效
- window.location.replace(window.location.href);
- window.location.assign(window.location.href);
- window.location.assign(location.href);
- window.navigate(location.href);
- window.open(”自身页面”,”_self”);
- window.location.reload(true);
- document.URL=window.location.href
转载本站文章请注明,转载自:神秘果
本文链接: http://www.shenmiguo.com/archives/2008/78_webpage-refresh.html
Tags: javascript, 页面刷新
Leave a Reply