-3
を閉じる方法:close()
メソッドを使用するこれは私が試したものです現在のタブに
<html> <head> <script language="javascript" type="text/javascript">
var parentWindow = this;
function closeWindow() {
// window.top.close(); this.parentWindow.close(); //window.open('','_parent','');
//window.close();
// var x=confirm('Are You sure want to exit:'); //if(x) window.close(); /*var childWindow = window.open("GAJANAN", "New Tab Window", "width=700,height=700"); setTimeout(function(){ childWindow.close(); }, 1500);*/ } </script>
</head> <body>
<br> <a href="javascript:closeWindow();">Close Window</a> <br><br> <a href="javascript:window.open('','_self').close();">close</a> <br><br><br> <!-- saved from url=(0014)about:internet --> <a href="#" onclick="javascript:window.close();opener.window.focus();" >Close Window - javascript:window.close();opener.window.focus();</a> </body> </html>
私は、プログラムで開いた場合にのみ、プログラムでウィンドウ/タブを閉じることができると思います。 –
[ブラウザウィンドウで現在のタブを閉じるにはどうすればいいですか?](https://stackoverflow.com/questions/2076299/how-to-close-current-tab-in-a-browser-window) –