title: Evaluating functions for transfer in IE8
body: <p>I need to transfer JavaScript Objects through JSON and transfer it's functions as well. I found a working version of getting the Strings of Functions and transfering them. Then i can evaluate them again.</p>
  
  <pre><code>//Create the function
  var myFunction = function(){alert('Hello, my Function!');}
  //get the functions String reprensentation
  var myFunctionTransferString = myFunction.toString();
  
  //Now we transfered the object and want to have a function back
  var myTransferedFunction = eval('(' + myFunctionTransferString + ')');
  //call the transfered function
  myTransferedFunction();
  </code></pre>
  
  <p>Here i have a jsfiddle for this: <a href="http://jsfiddle.net/bMjug/" rel="nofollow">http://jsfiddle.net/bMjug/</a></p>
  
  <p>This is working in Firefox, Chrome, and Safari as it should (but as you can guess not in that great pieace of microsoft software called Internet Explorer).</p>
  
  <p>At the line where i want to evaluate the function i get the message <code>fn is null or not an object</code> in IE8.</p>
  
  <p>Actually i found a solution for this but i really don't like this solution. If i put the variable declaration into the String i'm evaluating and remove the parantheses because i'm not expecting an object anymore that would do what i want:</p>
  
  <pre><code>eval('var myTransferedFunction = ' + myFunctionTransferString);
  </code></pre>
  
  <p>But i find this kind of hacked and bad solution.</p>
  
  <p>Does anyone now a better one for this problem?</p>
  
  <p>Thanks in advance</p>