title: remove CoffeeScript anonymous function calls
body: <pre><code>buildIMG = (src, resize) -&gt;
    html  = '&lt;div class="left"&gt;&lt;div class="foods_image"&gt;'
    html += '&lt;a onclick="popitup("http://somewhere.com/test" href="javascript:void(0)"&gt;'
    html += '   &lt;img src="'+src+'" '+resize+' /&gt;'  
    html += '&lt;/a&gt;'
    html += '&lt;/div&gt;&lt;/div&gt;'
    html
  
  popitup = (url) -&gt;
    newwindow=window.open(url,'name','height=640,width=640')
    newwindow.focus() if window.focus
      false
  </code></pre>
  
  <p>I currently have a bookmarklet that inserts javascript code(the one above) into a website. I wrote the above coffeescript and it generates this:</p>
  
  <pre><code>(function() {
    var buildIMG, popitup;
  
    buildIMG = function(src, resize) {
      var html, nbsp;
      html = '&lt;div class="left"&gt;&lt;div class="foods_image"&gt;';
      html += '&lt;a onclick="popitup(\'http://somewhere.com/test\');" href="javascript:void(0)"&gt;';
      html += '   &lt;img src="' + src + '" ' + resize + ' /&gt;';
      html += '&lt;/a&gt;';
      html += '&lt;/div&gt;&lt;/div&gt;';
      return html;
    };
    popitup = function(url) {
      var newwindow;
      newwindow = window.open(url, 'name', 'height=640,width=640');
      return newwindow.focus()(window.focus ? false : void 0);
    };
  }).call(this);
  </code></pre>
  
  <p>I snipped the functions that uses buildIMG. That function creates an overlay over the site and displays all images in that overlay. buildIMG is called for each image to create the html.</p>
  
  <p>The problem is that the <code>onclick="popitup("http://somewhere.com/test"</code> portion doesn't work. It is undefined.</p>
  
  <p>A solution I did was to remove this which was generated by CoffeeScript:</p>
  
  <pre><code>(function() {
  
  }).call(this);
  </code></pre>
  
  <p>It was fixed as soon as I removed that. How do I not have CoffeeScript put in those lines in my generated javascript?</p>