<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>DIV弹出对话框</title>
<meta name="author" content="Known Chen www.cnblogs.com/known" />
<style type="text/css">
html{
height:100%;max-height:100%;background:#fff;
font:normal 10pt verdana,arial,sans-serif;
}
body{height:100%;max-height:100%;}
</style>
<script type="text/javascript" src="Pop.js"></script>
</head>
<body>
<div style="padding:200px;">
<form name="form1" method="post">
<div id="d"></div>
<input type="button" id="Button1" value="弹出编辑信息" />
<input type="button" id="Button2" value="弹出页面" />
<input type="button" id="Button3" value="确认信息" />
<input type="button" id="Button4" value="等待信息" />
</form>
</div>
<script type="text/javascript">
function $(id) { return document.getElementById(id); }
function ok() {
Pop.close({id:'update',msg:$('t').value});
}
$('Button1').onclick = function() {
var p = {
title: '修改信息',
info: '<form name="f" method="post">请输入<input type="text" id="t" /><input type="button" value="确定" onclick="ok();" /></form>',
width: 350,
height: 100,
onCallback: function(r) { $('d').innerHTML = r.id + ':' + r.msg; }
};
Pop.show(p);
}
$('Button2').onclick = function() {
var p = {
title: '查询页面',
url: 'https://ca.pzhu.cn:8443/CA_SSH/msg/showAppMsg.action?msgType=2&msgContent=log27',
width: 350,
height: 100,
onCallback: function(r) { $('d').innerHTML = r.id + ':' + r.name; }
};
Pop.show(p);
}
$('Button3').onclick = function() {
var c = {
info: '确认提交?',
ok: function() { Pop.wait(); document.forms[0].submit(); },
cancel: function() { return false; }
};
Pop.confirm(c);
return false;
}
$('Button4').onclick = function() {
Pop.wait();
}
</script>
</body>
</html>