The following two lines of javascript code cause the Uncaught SyntaxError:
var testObj = JSON.parse('{ testFunc: function () { console.log("whoa there"); }}');
testObj["testFunc"]();
I don’t understand what is invalid about my json string.
As far as I am aware, that is not a JSON string, but rather javascript held by a string literal. JSON is, just like XML, a means to represent data across multiple platforms. Please have a look at the specification for JSON:
http://www.json.org
If you want to pass values that are actually functions, you need to use the javascript
evalmethod alternatively let JSON string values work as keys to an object that maintains these methods.