I get this html as response when i post api call, so i want to know how i can read client_id and session_token with jquery or some simple javascript code??
function getNewsFeed(d) {
var c = {
page_num: b,
num_events: d,
return_as_html: true,
source: "web"
};
TAGGED.api.call(c, check)
}
Now want to check things:
function check() {
// checking here
}
["{\"stats\":\"ok\",\"dia\":\"44\",\"result\":{\"success\":true,\"session_token\":\"969ndg1ai0c43034\",\"next_event_id\":0,\"client_id\":1314852}}"]
I dont have JSON so cant read it with JSON.parse i tried using but in firebug it does not show JSON
i get same code in response and html when i check it with firebug.
Thanks.
JSON.parseis part of any modern browser implementation. If the[]are part of the response, pass the first item of the array toJSON.parse.$.parseJSON()but if the native JSON parser didn't work, your problem is probably elsewhere.JSONinterface, you can always include json2.js. Note that the response is an array with a string where the string itself contains JSON as well. So you have to parse the response twice, once to get the array and then the string inside the array.