I have an ajax response from my server. Example below:
{"user_id":"93","status_message":"Cool Status","timestamp":"1305648702"}
I tried reading the response using:
var json = eval(response);
var userid = json.user_id;
The above does not seem to work though. Any ideas.
You should use the JSON parser that is built in to many browsers these days. If it’s not available, you can use the JSON2 library, which provides the same interface, as a fallback.