ウィンドウの内容を示すエレメントを取得する

書式

 windowObj.getContent()

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

説明

 ウィンドウの内容を示すエレメントを取得するにはgetContent()を使います。これによりウィンドウに表示する内容を示すタグの情報を取得することができます。ウィンドウ内に文字などを表示するにはinnerHTMLなどを使います。

サンプルコード [実行]

<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;
function openWin(){
win = new Window("win01", {
title: "Sample",
className: "dialog",
top:50, left:80,
width:320, height:240,
zIndex: 100,
resizable: true,
draggable:true
});
win.setDestroyOnClose();
win.getContent().innerHTML = new Date();
win.show();
}
// --></script>
</head>
<body>
<h1>ウィンドウ内に文字を表示する</h1>
<form>
<input type="button" value="開く" onClick="openWin()">
</form>
</body>
</html>