日期:2014-05-16 浏览次数:20400 次
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>dialog demo</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<button id="open">打开</button>
<div id="dialog" title="标题">
内容
<button id="close">关闭</button>
</div>
<script>
$( "#dialog" ).dialog({ autoOpen: false });
$("#close").click(
function()
{
$("#dialog").dialog("close");
}
);
$( "#open" ).click(
function()
{
$( "#dialog" ).dialog( "open" );
}
);
</script>
</body>
</html>
function opendialog()
{
//获取数据的代码
$("#dialog").prepend("动态获取到的内容").dialog("open");
}