I am trying to associate an event with all the dialog boxes that were created on the page using the JQuery UI Dialog function (regardless of whether they were shown or not). I can't seem to figure out which selector will deliver me. I tried both .ui-dialog and .ui-dialog-content without success.
Since I am trying to create a generic method, I will not know the identifiers of the dialogs that can be created.
I am using the following code for testing. It works if I specify the dialog identifier ( #mydialog ), but during the production process I will not know them.
$("div.ui-dialog").bind("dialogclose", function(event, ui) { window.alert("close fired"); }
jquery-ui-dialog
Brian glick
source share