title: Uncaught TypeError: Illegal invocation on callback
body: <pre><code>function submit() {
      console.log('Submit!');
  }
  
  function foo(callback, param) {
  
      console.log(callback);
  
      // ... //
  
      callback(param); // &lt;-- Script fails here
  
  }
  
  &lt;input type="button" onclick="foo(submit)"&gt;
  </code></pre>
  
  <p>Why isn't this working?</p>
  
  <pre><code>function submit() { [native code] } foo.js:241
  Uncaught TypeError: Illegal invocation 
  </code></pre>