title: ReferenceError: function is not defined when using onclick
body: <p>I set up an anchor tag using javascript so that that <code>onclick</code>, I call a function <code>showSavingsEasterEgg</code> and pass it a value. The problem I am getting is that I'm not referencing my function correctly:</p>
  
  <p><code>ReferenceError: showSavingsEasterEgg is not defined</code></p>
  
  <p>I've tried moving the <code>showSavingsEasterEgg</code> function into the <code>showData</code> function to see if it solved the scoping problem, but it didn't.</p>
  
  <p>Any tips</p>
  
  <pre><code>define(["jquery", "go/util", "underscore", "jqueryui/slider"], function ($, util,_) {
  
    function showData(data) {
      $('#item').append('&lt;a class="savings_link" href="#" onclick=\'showSavingsEasterEgg('+data[key]['saving']+')\'&gt; Savings');
    }
  
    function showSavingsEasterEgg(data){
      console.log("SUccess");
      console.log(data);
    }
  
  });
  </code></pre>