js常用跳转

1.在js中使用的语句

1.1返回上一个页面并且刷新2020-03-27

self.location=document.referrer

 

1.2 直接跳转界面

 window.location.href="你要跳转的地址"

1.3返回上一个

onclick="window.history.go(-1)"

1.4  更改父窗口的位置。

window.parent.close();

1、window.parent.open("about:blank","_self").close() ;

2、 window.parent.location.href="{:url('您需要跳转的地址')}";

关闭Iframe弹窗:window.parent.getElementById("放Ifarme的id").style.display = "none";//隐藏Iframe弹窗

关闭Iframe弹窗并刷新:parent.location.reload();

打开新页面:location.replace("/login/index");

 

posted @ 2020-03-27 14:47  以己为镜  阅读(192)  评论(0编辑  收藏  举报