javascript关闭当前窗口 [英] javascript close current window
本文介绍了javascript关闭当前窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请帮助Java脚本关闭当前窗口. 这是我的代码,它不起作用.
please help java script about close current window. this is my code and it does not work.
<input type="button" class="btn btn-success"
style="font-weight: bold;display: inline;"
value="Close"
onclick="closeMe()">
function closeMe()
{
window.opener = self;
window.close();
}
我试过了,但是也没用
var win = window.open("","_self");
win.close();
推荐答案
我知道这是一篇老文章,自2017年以来发生了很多更改,但是我发现可以使用以下命令关闭当前的标签页/窗口:>
I know this is an old post, with a lot of changes since 2017, but I have found that I can close my current tab/window with:
onClick="javascript:window.close('','_parent','');", now in 2019.
这篇关于javascript关闭当前窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文