title: How to execute function after opening a jQueryUI Dialog?
body: <p>On my web page i have some links like : </p>
  
  <pre><code>&lt;div id="toolbarButtons"&gt;
      &lt;a href="actualites/addLink" id="liens" rel="lien" title="Insérer un lien" class="toolbarButton"&gt;&lt;span&gt;&lt;img src="pub/struct/picto/icon_toolbar-link.gif" alt="Liens" /&gt;Lien&lt;/span&gt;&lt;/a&gt;
      &lt;a href="actualites/addImage" rel="image" title="Insérer une image" id="img" class="toolbarButton"&gt;&lt;span&gt;&lt;img src="pub/struct/picto/icon_toolbar-img.gif" alt="Liens" /&gt; Image(s)&lt;/span&gt;&lt;/a&gt;
  &lt;/div&gt;
  &lt;div id="dialogbox"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>First of all i init my dialogbox by calling : </p>
  
  <pre><code>initDialog : function() {
      $('#dialogbox').dialog({
          bgiframe:true,
          autoOpen:false,
          width:500,
          modal:true
      });
  }
  </code></pre>
  
  <p>then i attach the the dialog on click event : </p>
  
  <pre><code>$('.toolbarButton').click(function(e){
              e.preventDefault();
              actu.dialogManager($(this));
  });
  
  dialogManager : function(elem) {
  
      elem.blur();
      var title   = elem.attr('title');
      var href    = elem.attr('href');
      var rel     = elem.attr('rel');
  
      $('#dialogbox').dialog('option','title',title);
  
      if(rel == 'lien')
      {
           $('#dialogbox').dialog('option','buttons',{
              'Add' : function(){
                              //TODO
              },
              'Cancel' : function(){
                  $('#linkText').val('');
                  $('#linkUrl').val('');
                  $(this).dialog('close');
              }
          });
  
          $('#dialogbox').load(href).dialog('open');
  
      }
  }
  </code></pre>
  
  <p>As you can see , the content of the dialog box is fetched with ajax. The dialog contain some input.
  I have a last function which is supposed to edit the content of the input but i don't know how and where to call it. It need to be called after the opening of the dialog to be efficient. How can i do that ?</p>
  
  <p>doing it juste after </p>
  
  <pre><code>$('#dialogbox').load(href).dialog('open');
  </code></pre>
  
  <p>won't work because of the asynchronous loading (called before the dialog is fully loaded).</p>
  
  <p>Thanks for your help.</p>