I have an object and I want to show its content.
{"text": "active user
active user213123
idle user234234234
loggedout userafdadf"
},
I did Response = message.split(":")[1]; and I got:
"active user
active user213123
idle user234234234
loggedout userafdadf"
},
then: var value = message.split("}")[0]; and I got:
"active user
active user213123
idle user234234234
loggedout userafdadf"
So now how can I get rid of "" so I can have the raw valu of text? and beside that is there any other way to retrive a value of the object? because this way seems crazy..
I put the whole object that I am fetching the "text" from that here: (thats what chrome debugger is showing after console log)
{
getResponseHeader: function ( key ){}
pipe: function ( /* STDone, STFail, STProgress */ ) {
progress: function () {
promise: function ( obj ) {
readyState: 4
TextContent: "{"text": "active user
active user213123
idle user234234234
loggedout userafdadf"}"
Suppose they are in message variable and then I did Response = message.TextContent; and after console.log I received:
TextContent: "{"text": "active user
active user213123
idle user234234234
loggedout userafdadf"}"
Now I want the raw value of text
messagecome from? Why does it have a trailing comma?user,active,idleandloggedout. but your question asks how do you get the value oftextwhich is just text as it's not a correctly formatted to get the individual values