title: jquery ui dialog global variable
body: <p>I'm tring to create a jquery ui dialog without having a empty div container for the dialog in the HTML. For some reason, the global variable isn't recognized in other javascript functions (besides the original javascript function).</p>
  
  <pre><code>var $signOutDialog = null;
  
  
  function createDialog() {
      var $signOutDialog = $("&lt;p&gt;&lt;/p&gt;").dialog({
          resizable: false,
          title: 'Sign Out',
          width: 830,
          autoOpen: false,
          modal: true,
  
      });
  }
  </code></pre>
  
  <p>and then i have another javascript function which gets called as a result of a $.ajax success delegate. the <code>$signOutDialog</code> global variable is NULL in this function.</p>
  
  <pre><code> function test2() {
       $signOutDialog.dialog('close'); 
   }
  </code></pre>
  
  <p>any known solution for closing a  jquery ui dialog without having the dialog as an empty html element?</p>