There are several responses here regarding this question or one similar - they are either obsolete or inaccurate.
I am trying to add my own custom close element to a jQuery UI dialog. I'm guessing I need to either use a delegated handler or be able respond to some event fired by the dialog function.
Obviously $(document).ready() won't work because the dialog happens after the document is loaded.
So - how do go about this? I'm sure I'm missing something pretty simple. (hopefully) Ref: https://api.jqueryui.com/dialog
So far, the feedback I'm getting presumes that there is an element on which I can attach an event handler... It does NOT exist at the time that the script run for the page in question
That works WHEN and only when I run it from a debug window with the dialog box open. When I put that simple command in the script attached to the page... nothing gets attached The command I used in this example is very very simple
jQuery( ".name-group-name" ).click(function() {
console.log('hello');
});
Profile
That creates a link that when clicked creates a modal (dialog) that is completely separate from the page from which it is called. – sea26.2 Jun 27 '19 at 02:46