dialog create and open behaviors
I would like to "reuse" a dialog on a page by modifying the content of
the div depending on which link will open the dialog.
If I have 2 links to "open" the same dialog, is there a test to
determine if it's already created?
Doing this: $('mydialog').dialog('open') when the dialog hasn't been
created doesn't work.
I cant' just do this $('mydialog').dialog() from both links because if
it has been created and closed, it doesn't reopen when called.
Are there any problems with doing this:
function openDialog(){
$('#mydialog').dialog();
$('#mydialog').dialog('open');
}
<a href="#" onclick="openDialog();">Link 1</a>
<a href="#" onclick="openDialog();">Link 2</a>