title: jquery on click event that call a named function
body: <p>I have a jQuery <code>onClick</code> handler, writed with an anonymous function like that:</p>
  
  <pre><code>$("#selector").on("click" function(){
      // do something
  })
  </code></pre>
  
  <p>I would generalize the anonymous function extracting the logic in a named function, that drive me to something like:</p>
  
  <pre><code>$("#selector").on("click" namedFunction())
  
  function namedFunction(){
      // do something
  }
  </code></pre>
  
  <p>To me seemed a good solution. But there's a drawback since the <code>namedFunction</code> is executed as soon script is loaded. <a href="http://jsfiddle.net/EgYxg/" rel="noreferrer"><strong>Here</strong></a> you can test the bad behaviour.</p>