ウィンドウオブジェクトを破棄する

書式

 windowObj.destroy()

windowObj : ウィンドウオブジェクト

説明

 ウィンドウオブジェクトを破棄するにはdestroy()を使います。

サンプルコード [実行]

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="default.css" type="text/css" media="all">
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="effects.js"></script>
<script type="text/javascript" src="window.js"></script>
<script type="text/javascript"><!--
var win;
window.onload = function(){
win = new Window("win01", {
title: "Sample",
className: "dialog",
top:50, left:120,
width:320, height:240,
zIndex: 100,
resizable: true,
draggable:true
});
win.setDestroyOnClose();
win.show();
}
function destroyWin(){
win.destroy();
}
// --></script>
</head>
<body>
<h1>ウィンドウを破棄</h1>
<form>
<input type="button" value="ウィンドウを破棄" onClick="destroyWin()">
</form>
<div id="result"></div>
</body>
</html>