title: Uncaught ReferenceError for a function defined in an onload function
body: <p>HTML:</p>
  
  <pre><code>&lt;div id="myID" onclick="cc(this.id)"&gt;Click Here&lt;/div&gt;​
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>var timer;
  var firing = false;
  var begen = function(id) {
      alert('tek');
  };
  
  var popupAc = function(id) {
      alert('çift');
  };
  
  function cc(id) {
      if (firing) {
          popupAc(id);
          clearTimeout(timer);
          firing = false;
          return;
      }
      firing = true;
      timer = setTimeout(function() {
          //begen(id);
          clearTimeout(timer);
          firing = false;
      }, 250);
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Uncaught ReferenceError: cc is not defined 
  </code></pre>
  
  <p>Example: <a href="http://jsfiddle.net/LXSZj/3/" rel="nofollow">http://jsfiddle.net/LXSZj/3/</a></p>