jQuery event fires on doc ready
<p>I am trying to set the click event of a button on my form and for some reason I am getting weird behavior. When I bind the click event to a function that takes no arguments, things seem to work fine. But when I bind the event with a function that takes an argument, the event fires on document ready and on click. Any ideas?</p>

<p><strong>Example 1:</strong></p>

<p>This causes an alert box to fire on ready and when the button is clicked.</p>

<pre><code>jQuery(document).ready(function(){
   $('myButton').click(alert('foo'));
});
</code></pre>

<p><strong>Example 2:</strong></p>

<p>This causes an alert box to fire <strong>ONLY</strong> when the button is clicked.</p>

<pre><code>jQuery(document).ready(function(){
   $('myButton').click(wrapper);
});

// External js file
function wrapper(){
   alert('bar');
}
</code></pre>
