UI Dialog

UI Dialog


Dear all,
I've got a question regarding UI Dialog.
1. Does a UI Dialog has to be initialized before the DOM is ready?
Because I'd prefer to call it when it is clicked by a hyperlink. But
if I call it this way it won't show up after I click it for the second
time.
2. Related to the one above, do I have to attach a click listener to a
hyperlink that will call the dialog? Why can't I just put an onclick
attribute inline on my hyperlink?
Thank you in advance.