目次 |
---|
・ウィンドウを閉じる(IE8) ・ウィンドウを閉じる(Chrome23) |
<html> <head> <title></title> </head> <body> <script type="text/javascript"> function a() { self.close(); } </script> <button onclick="a();">ボタン</button> <body> <html>
<script type="text/javascript" language="JavaScript"> <!-- function close_win(){ var nvua = navigator.userAgent; if(nvua.indexOf('MSIE') >= 0){ if(nvua.indexOf('MSIE 5.0') == -1) { top.opener = ''; } } else if(nvua.indexOf('Gecko') >= 0){ top.name = 'CLOSE_WINDOW'; wid = window.open('','CLOSE_WINDOW'); } top.close(); } --> </script>