I have an item that contains data which I need to display.
{"text": "active user
active user213123
idle user234234234
loggedout userafdadf"
},
To extract the content, I used the following code:
Response = message.split(":")[1];
, and received:
"active user
active user213123
idle user234234234
loggedout userafdadf"
},
Further, when I tried this code:
var value = message.split("}")[0];
, I got:
"active user
active user213123
idle user234234234
loggedout userafdadf"
Now, how can I eliminate the extra quotation marks so that I only get the raw text value? Additionally, is there a simpler way to retrieve the value from this object? The current method seems overly complex.
The entire data object that I'm extracting the "text" from is displayed below (as shown in Chrome debugger 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"}"
Assuming the data is stored in the message variable, when I entered Response = message.TextContent;
and viewed the console.log output:
TextContent: "{"text": "active user
active user213123
idle user234234234
loggedout userafdadf"}"
Finally, my goal is to obtain the unprocessed text value.