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 typ
You can use JSON.stringify with a replacer like:
replacer
JSON.stringify({ color: 'red', doSomething: function (arg) { alert('Do someting called with ' + arg); } }, function(key, val) { return (typeof val === 'function') ? '' + val : val; });