Olga Real Olga Real - 16 days ago 4x
Ajax Question

JSON that contains functions

I have a website that returns a JSON-like data structure like this:

"name":"tom jones",
"no": 123,
"storedproc": function(){

I'm getting this data using
with dataType "JSON". Unfortunately, my
calls the error callback because my data contains a function().
How can I parse this correctly? I really need to store the function in a variable and call it later.


Could you arrange to have the server return JSON like this:

{"name":"tom jones",
  "no": 123,
 "storeprocFn": callbuyer,
 "arg": "0123"};

Then your callback function can call the callbuyer function and pass arg