title: What does function() mean in jQuery? What is the difference between this and $(this)
body: <p><strong>Question 1</strong></p>
  
  <p>I've just started learning jQuery and one thing that puzzles me is <code>function()</code> with a parameter in it, ie: <code>function(e)</code>.</p>
  
  <p><strong>[Example 1]</strong></p>
  
  <pre><code> $("#rating a").click(function(e){
       // stop normal link click
       e.preventDefault();
   }
  </code></pre>
  
  <p>What is <code>e</code> in <code>function(e)</code>? </p>
  
  <p><strong>[Example 2]</strong></p>
  
  <pre><code>$.post("test.php", function(data) {
      alert("Data Loaded: " + data);
  });
  </code></pre>
  
  <p>How do you know what <code>data</code> is? I assume <code>data</code> is different from <code>e</code> in example 1.</p>
  
  <p><em><strong>I'm confused as to why</em> <code>function()</code> <em>is different in different senarios...</em></strong></p>
  
  <hr>
  
  <p><strong>Question 2</strong>
  Since we are talking about basic jQuery, here's another jQuery question. What is the difference between <code>this</code> and <code>$(this)</code>? </p>
  
  <p><strong>[Example 3]</strong></p>
  
  <pre><code>$(document).ready(function() {
   // use this to reset several forms at once
  $("#reset").click(function() {
      $("form").each(function() {
          this.reset();
      });
  });
  </code></pre>
  
  <p><strong>[Example 4]</strong></p>
  
  <pre><code>   $("a").hover(function(){
         $(this).parents("p").addClass("highlight");
     },function(){
         $(this).parents("p").removeClass("highlight");
     });
  </code></pre>
  
  <p>});</p>