トップ> javascript> 自動的に数秒後に閉じて、呼び元(親)をリロード
自動的に数秒後に閉じて、呼び元(親)をリロード
自動的に数秒後に閉じて、呼び元(親)をリロード
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script language="javascript" type="text/javascript">
<!--
var timer;
function laterexe(){
timer = setInterval("childclose()",3000);
}
function childclose(){
clearInterval(timer);
window.opener.location.reload();
window.opener = window;
var win = window.open(location.href,"_self");
win.close();
}
-->
</script>
<title>完了画面</title>
</head>
<body onload="laterexe();">
<script type="text/javascript" >
function close_reload(){
window.opener.location.reload();
window.close();
}
function close_only(){
window.close();
}
</script>
<div>
正常に終了しました。3秒後に自動的に閉じます。自動で閉じない場合は下のボタンをクリックしてください。
</div>
<form>
<input type="button" name="wclose_only" value="閉じる" onclick="return close_only();" />
<input type="button" name="wclose_reload" value="閉じる+リロード" onclick="return close_reload();" />
</form>
カテゴリ内の記事
- 子ウィンドウを自動でクローズ(2010/02/22)
- 自動的に数秒後に閉じて、呼び元(親)をリロード(2010/03/30)
