title: JQuery - $this is not defined
body: <p>Trying to get this code to work but the error I am getting in firebug is <code>$this is not defined</code> and I don't understand why</p>
  
  <p>To explain the background about this code I have a list of spans with identical classes so when I click on particular span I need to send an ajax request and update that particular span.</p>
  
  <p>Hopefully that makes sense.</p>
  
  <pre><code>$(document).ready(function() {
  
  function postAndFade($node, post_key) {
      var id = $node.parents('.id').find('.id-value').text();
      var post_val = $node.text();
      $node.fadeOut('slow');
  
      $.ajax({
          type: "POST",
          url: "process.php",
          data: "id="+id+"&amp;"+post_key+"="+post_val,
          success: function(data) {
             $node.html(data);
             $node.fadeIn('slow');        
          }
      });
  return false;
  }
  $('.featured-value').click(function() { return postAndFade($this, 'featured'); });
  $('.visible-value').click(function() { return postAndFade($this, 'visible'); });
  });
  </code></pre>