总结JS实现页面的刷新和跳转

时间:2014-05-30 20:23:05   收藏:0   阅读:302

使用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>");

 

用js实现页面跳转方式

第一种

<script language="javascript" type="text/javascript">

window.location.href="login.jsp?backurl="+window.location.href;

</script>

第二种:

<script language="javascript">

alert("返回");

window.history.back(-1);

</script>

第三种:

<script language="javascript">

window.navigate("top.jsp");

</script>

第四种:

<script language="JavaScript">

self.location=‘top.htm‘;

</script>

第五种:

<script language="javascript">

alert("非法访问!");

top.location=‘xx.jsp‘;

</script>

总结JS实现页面的刷新和跳转,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!