title: jQuery - Remove a table row after it's deleted from database
body: <p>I'm try to remove the deleted table row after it's been successfully deleted from the database but it not working. Here is my code.</p>
  
  <p><strong>This works:</strong></p>
  
  <pre><code>$('table td img.delete').click(function(){
      if(confirm("Are you sure you want to permanently delete this?"))    
      $(this).parent().parent().remove();
      }
  });
  </code></pre>
  
  <p><strong>This doesn't work:</strong></p>
  
  <pre><code>$('table td img.delete').click(function(){
      if(confirm("Are you sure you want to permanently delete this?"))    
      $.get('cfc/action.cfc?method=deleteLetter&amp;returnformat=plain', {id: $(this).attr('id')},
          function(data){
              if(data.replace(/^\s+|\s+$/g, '')==='ok'){
              $(this).parent().parent().remove();
              }
          });
      }
  });
  </code></pre>
  
  <p>This record get deleted here but the table row remains. Any suggestion would be much appreciated.</p>
  
  <p>thanks!</p>