title: How to extract annonym javascript functions
body: <p>I defined my javascript jquery function in a separate file:</p>
  
  <pre><code>function setupSlider($, url) {
      genImgUrl = url + '/gensvg/';
      $("#slider").slider({
          min : -2000,
          max : 2000,
          value : 0,
          change : function(event, ui) {
              $('#svgImg').hide();
              $.ajax({
                  type : "POST",
                  url : genImgUrl,
             ...
          },
          slide : function(event, ui) {
              var v = 50;
              ...
              $('#value').text(ui.value).css('left', (v - 0.5) + '%');
          }
      });
      $('#min').text($('#slider').slider('option', 'min'));
      $('#max').text($('#slider').slider('option', 'max'));
  };
  </code></pre>
  
  <p>I would like to separate the functions for the <code>change</code> and <code>slide</code> option into a <em>defined</em> function <code>changeAction</code> and <code>slideAction</code>. But I have problems with my parameters <code>$</code>, <code>genImgUrl</code> and the <em>jquery slider</em> parameters <code>event</code>, <code>ui</code>. How do you merge them? You need the bind function, right?</p>
  
  <p>Thanks!</p>