js刷新父页面

页面1
topFrame
leftFrame
mainFrame

在"topFrame"里点击链接或按钮,刷新"页面1"
该怎么做?

第1个回答  2011-04-04
简单回答:自己看,不再赘述
用iframe、弹出子页面刷新父页面

iframe
parent.location.reload();

弹出子页面
window.opener.location.reload();

子窗口刷新父窗口

self.window.opener.locaction.reload();

刷新一open()方法打开的窗口

window.opener.location.href = window.opener.location.href

刷新以winodw.showModelDialog()方法打开的窗口

window.parent.dialogArguments.document.execCommand('Refresh');



Response.Write("<script>window.location.href = window.location.href</script>");

刷新本页Response.Write("<script>window.location.href=window.location.href; </script>");

刷新父页和本页面:

Response.Write("<script>alert('提交成功!');window.location.href=window.location.href;window.opener.location=window.opener.location;</script>");本回答被提问者采纳
第2个回答  2019-06-20

1、复制代码代码。

2、返回并刷新页面:location.replace(document.referrer);document.referrer //前一个页面的URL不要用 history.go(-1),或 history.back();来返回并刷新页面。

3、页面自动刷新:把如下代码加入<head>区域中 <meta http-equiv="refresh" content="20"> 其中20指每隔20秒刷新一次页面。

4、页面自动跳转:把如下代码加入<head>区域中 <meta http-equiv="refresh" content="20;url=http://www.jb51.net"> 其中20指隔20秒后跳转到http://www.jb51.net页面 。

5、刷新本页:Response.Write("<script language=javascript>window.location.href=window.location.href;</script>")。

6、转到指定页:Response.Write("<script language=javascript>window.location.href='yourpage.aspx';</script>")。

本回答被网友采纳

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网