title: create anonymous methods using "eval" - browser specific behaviour
body: <p>I working with jQuery and i needed to generate an anonymous method with the eval() function.  </p>
  
  <p>The following lines worked with Opera but not with IE, FF, Chrome:  </p>
  
  <pre><code>var callbackStr = "function(){alert('asdf');}";  
  var callback = eval(callbackStr);  
  callback();
  </code></pre>
  
  <p>This code works with all Browsers:  </p>
  
  <pre><code>var callbackStr = "var callback = function(){alert('asdf');}";  
  eval(callbackStr);  
  callback();  
  </code></pre>
  
  <p>You see, I already solved my problem. But I want to know, what exactly is happening. Can anybody explain this behaviour to me, or tell me where i can find further information?</p>
  
  <p>(PS: I know <a href="http://www.google.com/" rel="noreferrer">this page</a>.)</p>