title: Why are non-anonymous functions being executed when using click event handler?
body: <p>I've been exploring the use of custom functions for event handlers.  In this stripped down example, I'm trying to get an alert to pop up when the user clicks a button.  </p>
  
  <p>But the alert box pops up immediately as the page loads!  What am I doing wrong?  ( the commented portion does the exact same thing).</p>
  
  <p>If I define the bclick() function like</p>
  
  <pre><code>function bclick(foo, bar){ ... }
  </code></pre>
  
  <p>The result is also the same.</p>
  
  <p>JS in the header:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var bclick = function(foo, bar){alert( foo + "  " + bar + "\n");}
  
  //$(document).ready(function(){
  //    $("button").click(bclick("Button","Clicked"));
  //    });
  
  $("button").click(bclick("Button","Clicked"));
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Relevant HTML in the body:</p>
  
  <pre><code>&lt;button&gt;Click Me!&lt;/button&gt; 
  </code></pre>