这是我正在尝试做的一个示例。
<html>
<head>
<script type="text/javascript" language="javascript">
function doOpen() {
if ($('#dialog-modal').dialog('widget') == '')
document.getElementById('#dialog-modal').style.display = 'block';
else
$('#dialog-modal').dialog('open');
}
function doClose() {
if ($('#dialog-modal').dialog('widget') == '')
document.getElementById('#dialog-modal').style.display = 'none';
else
$('#dialog-modal').dialog('close');
}
function doAttach() {
$('#dialog-modal').dialog({
width: 'auto',
height: 'auto',
title: 'Popup Dialog',
autoOpen: false,
resizable: false,
modal: true
});
document.getElementById('dialog-modal').style.display = 'block';
}
</script>
</head>
<body>
<input type="button" id="Show" value="Open" onclick="doOpen();" />
<input type="button" id="Attach" value="Attach" onclick="doAttach();" />
<div id="dialog-modal" style="display:none">
Show this in a model dialog window<br />
<input type="button" id="Close" value="Close" onclick="doClose()" />
</div>
</body>
</html>
如果我在执行任何其他操作之前单击“附加”,对话框就会显示得很好。但是,如果我先单击“打开”,则会出现错误。我需要知道这条线应该是什么,以确定对话框模式是否已附加到对话框
if ($('#dialog-modal').dialog('widget') == '')