title: dialog is showing the same result
body: <p>i have this dialog to show the file name when you click on the icon. When i first click it the dialog will be empty then i close it and reopen the dialog will show the name (via ajax). Then when i close the dialog again and click on a different file icon its showing the first file name. then when i close it again and reopen it, it will show the correct filename. Why is it doing this?</p>
  
  <p>Here is my javascript</p>
  
  <pre><code>$('.edit').click(function(e){
  
      e.preventDefault();
      var auth = $(this).attr('id');
  
      $.ajax({
          type: 'POST',
          url: 'ajax/edit_filename.php',
          data: {auth:auth},
          success: function(result){
              filename = result;
          }
      });
  
      $( "#dialog" ).dialog({
        modal: true,
        resizable: false,
        title: 'Edit file name',
        buttons: {
            "Close": function() {
                $(this).dialog("destroy");
                $(this).dialog("cancel");
            }
        } 
      });
  
      $('.ui-dialog-content').html('&lt;input type="text" value="'+filename+'"/&gt;');
  });
  </code></pre>