説明
アラートダイアログを表示するにはDialog.alert()を使います。最初のパラメータに表示するHTML文字列を指定します。文字列でなく非同期通信でサーバーから読み込んだデータを表示させることもできます。2番目のパラメータはオプションで以下のものが指定できます。
プロパティ名 | 内容 |
top | Y座標 |
left | X座標 |
okLable | OKボタンに表示する文字列 |
ok | OKボタンがクリックされた時の処理 |
buttonClass | OKボタンに適用するCSSクラス名 |
<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">
<link rel="stylesheet" href="alert.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"><!--
function openDialog(){
Dialog.alert("本当に購入しますか?", {
windowParameters: {width:320, height:100},
okLabel: "はい",
ok:function(win){ alert("はい"); return true; }
});
}
// --></script>
</head>
<body>
<h1>アラートダイアログを開く</h1>
<form>
<input type="button" value="開く" onClick="openDialog()">
</form>
</body>
</html>