アラートダイアログを表示する

書式

 Dialog.alert(content, options)

content : 表示する内容または非同期通信データ読み込みオプション
options : オプション

説明

 アラートダイアログを表示するにはDialog.alert()を使います。最初のパラメータに表示するHTML文字列を指定します。文字列でなく非同期通信でサーバーから読み込んだデータを表示させることもできます。2番目のパラメータはオプションで以下のものが指定できます。

プロパティ名内容
topY座標
leftX座標
okLableOKボタンに表示する文字列
okOKボタンがクリックされた時の処理
buttonClassOKボタンに適用する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>