title: jQuery UI dialog boxes won't close
body: <p>I am using the following code to open a dialog box:</p>
  
  <pre><code>&lt;li&gt;
       &lt;input type="button" value="Preview" onclick="showPreview('EmailPreview');" /&gt;
  &lt;/li&gt;
  
  &lt;div id="dialog"&gt; 
      &lt;/div&gt;
      &lt;script type="text/javascript"&gt; 
        //&lt;![CDATA[
          $(document).ready(function () {
                  $('#dialog').dialog({
                  autoOpen: false,
                  modal: true,
                  height: 525,
                  resizable: false,
                  width: 600,
                  dialogClass: 'timer'
              });
          });
        //]]&gt;
      &lt;/script&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>In my .js file:</p>
  
  <pre><code>function showPreview(action, id) {
      $.get("/Manage/Account/" + action + "/" + id, function (data) {
          $("#dialog").html(data);
          $('#dialog').dialog('open');
          $('#Area, #Exchange, #Number').autotab_magic().autotab_filter('numeric');
          $("#dialog input[type='button'], #dialog select,#dialog input:checkbox,#dialog input:radio,#dialog input:file").uniform();
      });
  </code></pre>
  
  <p>I use this exact code in 3 locations. In one location everything is perfectly functional. In the other 2 locations, done exactly they same, just in different views, the dialog box will open but not close. Is there something obvious that I am missing?</p>
  
  <p>This is in the dialogbox-view:</p>
  
  <pre><code> &lt;div class="top"&gt;&lt;a onclick="$('#dialog').dialog('close'); return false"&gt;&lt;img src="/public/images/admin/btn-close.png" /&gt;&lt;/a&gt;&lt;/div&gt; 
  </code></pre>