您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

JS刷新页面的几种方法

2024/3/27 12:19:57发布15次查看
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.
____________________________________________
框架页中:(框架页中其中一个子页)
top.location.reload();   刷新整页  
self.location.reload();  刷新本页
window.parent.location.href='' 框架页重定向
_____________________________________________
自动刷新页面的方法:1.页面自动刷新:把如下代码加入<head>区域中<meta http-equiv="refresh" content="20">其中20指每隔20秒刷新一次页面.<body onload="opener.location.reload()"> 开窗时刷新<body onunload="opener.location.reload()"> 关闭时刷新。
例:数据添加成功后弹出对话框并刷新页面
if (infoaction_sort.insert(info_sort))
                {
                    scriptmanager.registerstartupscript(this.updatepanel, this.gettype(), alert, alert('相册分类添加成功');window.location.reload();, true);
//alert(相册分类创建成功);
                    //response.redirect(request.url.tostring());//刷新本页
                    this.txt_addsort.text = ;
                    this.txt_sortdepict.text = ;
                }
更多js刷新页面的几种方法。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product