P
paulfe4
i have an ajax request, where the server is returning:
{"PageDef": {
"pageName": "myname",
"queryName": "myqueryname",
"queryCtName": "myqueryctname"
}};
i have the following code handling it:
var jsontext = response.responseText;
alert( '(' + jsontext + ')' );
var jsonObj = eval( '(' + jsontext + ')' );
doSomethingWithObj( jsonObj );
the alert shows the returned content perfectly. but the eval does not
work. i'm getting "missing ) in parenthetical." for a long time i had
"not well-formed", and trying to include "var jsonObj = " in the
return, i would get "syntax error" i think. taking out the '(' an ')'
from the eval statement, i get "invalid label".
i looked around in a lot of places, but could not find anything
definitive on what *exactly* the server's JSON-formatted response
should look like.
can someone help me out?
thanks,
../paul
{"PageDef": {
"pageName": "myname",
"queryName": "myqueryname",
"queryCtName": "myqueryctname"
}};
i have the following code handling it:
var jsontext = response.responseText;
alert( '(' + jsontext + ')' );
var jsonObj = eval( '(' + jsontext + ')' );
doSomethingWithObj( jsonObj );
the alert shows the returned content perfectly. but the eval does not
work. i'm getting "missing ) in parenthetical." for a long time i had
"not well-formed", and trying to include "var jsonObj = " in the
return, i would get "syntax error" i think. taking out the '(' an ')'
from the eval statement, i get "invalid label".
i looked around in a lot of places, but could not find anything
definitive on what *exactly* the server's JSON-formatted response
should look like.
can someone help me out?
thanks,
../paul