Reputation: 57
I have a variable like this:
{ "Text" : "
Name: Useraafsdf
available Usef50d0fc138d9r213123
loggedout 0
" }
and I want to get the value of text. but when I write: console.log(Response.Text);
I get "undefined"
. How can I get the value? although I am taking this Response from here:
Response = messageObj.responseText;
So Maybe this "Text" is an object and not a json.
Upvotes: 0
Views: 27
Reputation: 160833
messageObj.responseText
is a string, you have to parse it.
var Response = JSON.parse(messageObj.responseText);
Upvotes: 2