title: jQuery - "Trigger a click" vs "Function call"?
body: <p>Say I have some actions binded to a link ( with .click or .live), and I want to do the same thing later, but I don't want duplicated code. Which is the correct way and why?</p>
  
  <p>This:</p>
  
  <pre><code>$('#link').click(function(){
   //do stuff
  });
  
  //called later
  $('#link').trigger('click');
  </code></pre>
  
  <p>OR:</p>
  
  <pre><code>$('#link').click(function(){
    do_stuff();
  });
  
  //called later
  do_stuff();
  
  //defined here
  function do_stuff(){
     //do stuff
  }
  </code></pre>