點擊打開對話框時,會顯示新舊內容。如果我添加$(this).dialog("destroy");
,則根本無法打開對話框。請讓我知道如何不顯示舊內容。jquery對話框以新舊內容打開
<script>
//display dialog box
$("#dialog-message").dialog({
autoOpen: false,
modal: false,
draggable: true,
resizable: true,
show: 'blind',
hide: 'blind',
width: 900,
dialogClass: 'ui-dialog-osx',
buttons: {
"I've read and understand this": function() {
$(this).dialog("close");
}
}
});
//click to open dialog box
$("#test").click(function() {
$("#dialog-message").dialog("open");
}
</script>
<p id="test">test</p>
<div id="dialog-message" title="Important information">
<form> </form>
</div>
謝謝Christos,它工作正常。 – tenzin
@Christos Lytras你可以好好檢查一下這個http://stackoverflow.com/questions/40830724/how-to-open-external-page-in-jquery-dialog-box-with-javascripts –