js无提示关闭浏览器页面的代码_javascript技巧
来源:懂视网
责编:小采
时间:2020-11-27 20:47:51
js无提示关闭浏览器页面的代码_javascript技巧
js无提示关闭浏览器页面的代码_javascript技巧:方法一: 代码如下: top.window.opener=null; top.window.open(,_self); top.window.close(); 方法二: 代码如下: top.window.opener = top; top.window.open('','_self',''); top.window.close(
导读js无提示关闭浏览器页面的代码_javascript技巧:方法一: 代码如下: top.window.opener=null; top.window.open(,_self); top.window.close(); 方法二: 代码如下: top.window.opener = top; top.window.open('','_self',''); top.window.close(

方法一:
代码如下:
top.window.opener=null;
top.window.open("","_self");
top.window.close();
方法二:
代码如下:
top.window.opener = top;
top.window.open('','_self','');
top.window.close();
_blank,在新窗口显示目标网页
_self,在当前窗口显示目标网页
_parent,框架网页中当前整个窗口位置显示目标网页
_top,框架网页中在上部窗口中显示目标网页
脚本之家自己用的函数
代码如下:
function closeWindow() {
window.open('','_parent','');
window.close();
}
js无提示关闭浏览器页面的代码_javascript技巧
js无提示关闭浏览器页面的代码_javascript技巧:方法一: 代码如下: top.window.opener=null; top.window.open(,_self); top.window.close(); 方法二: 代码如下: top.window.opener = top; top.window.open('','_self',''); top.window.close(