I have the following code to detect if a jquery ui dialog is open:
if ($("#dialog-myDialog").dialog("isOpen")) {
return;
}
which works fine but I found a situation where this code get called prior to the dialog being initialized in the first place and this if statement seems to just blow up in this case.
What is the best way to check if a jquery ui dialog has been initialized so I can properly handle this situation.