title: Javascript: stringify object (including members of type function)
body: <p>I'm looking for a solution to serialize (and unserialize) Javascript objects to a string across browsers, including members of the object that happen to be functions. A typical object will look like this:</p>
  
  <pre><code>{
     color: 'red',
     doSomething: function (arg) {
          alert('Do someting called with ' + arg);
     }
  }
  </code></pre>
  
  <p>doSomething() will only contain local variables (no need to also serialize the calling context!).</p>
  
  <p>JSON.stringify() will ignore the 'doSomething' member because it's a function. I known the toSource() method will do what I want but it's FF specific.</p>