How do I trigger a function from a string?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/359788/how-to-execute-a-javascript-function-when-i-have-its-name-as-a-string">How to execute a JavaScript function when I have its name as a string</a>  </p>
</blockquote>



<p>I have this function</p>

<pre><code>function myfunc() {
  alert('it worked!');
}
</code></pre>

<p>and this variable which is a string</p>

<pre><code>var callback = 'myfunc';
</code></pre>

<p>How do I trigger the function from that string?</p>
