« first day (3157 days earlier)      last day (1808 days later) » 

12:08 AM
@JennaSloan some of us enjoy the silence.
 
@StephanS Maybe so, but it is strange seeing this room so quiet.
 
12:33 AM
@jrh I don't think it matters, they both do the same thing
Just different ways
 
 
5 hours later…
5:50 AM
@jrh Whichever you use is your own preference. They both use the same repository.
 
 
3 hours later…
9:14 AM
@JennaSloan It was a lot less quiet 12 hours ago
 
9:29 AM
What are you still doing up forrest?
You are definitely ahead of the curve JBis. You've done what most high schoolers couldn't ever think about doing lol. When I was your age, I was thinking about ( . Y . ) and what kind of pizza i was going to order on the weekend. Good for you
 
 
4 hours later…
1:29 PM
hey fellas, I've got a node.js page responding with a readableStream and it's streaming the content to the client, now it just a huge string but I want to update a page when I receive content rather than update the page when the entire stream has been received, how can I do that?
 
2:07 PM
@JacobSchneider AJAX, websockets, take your pick.
 
Ite, get to it :D
 
right okay
 
 
3 hours later…
5:30 PM
if you have json object like so
how can you parse it
x = [{"0":1,"1":"string"}]
i've tried
let y = JSON.parse(x.responseText);
which have turned it to a "STRING"
let y = JSON.parse(x);
raises an error
VM125:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
 
 
1 hour later…
6:50 PM
@JRick that you are parsing an array
 
@weegee Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
@weegee its an arry that has JSON object inside , how can i parse it ?
 
To parse json. JSON.parse("this value has to be a string")
to parse it you have to first make it an object by doing x[0]. Then making the [Object object] a string by JSON.strigify(x[0]) which is useless
`let x = [{"0":1,"1":"string"}];
let json = JSON.parse(JSON.stringify(x[0]))` means the same thing as x[0]
 
@weegee what are u saying ? i should JSON.stringify(x[0]) first ?
it seems to be string anyway
this is how it look in console x ={"[{"0":1,"1":"qwdqwdq"}]"}
 
x[0] is your answer. no need of json functions
not it's an object
 
6:55 PM
var x = JSON.parse(req.responseText);
 
what is req.responseText?
 
but when i do X[0] it prints "[" only
req.onload = ()=>{var x = JSON.parse(req.responseText); }
 
you have to tell me the acutal value of x.
 
respond to the AJAx
x ={"[{"0":1,"1":"qwdqwdq"}]"}
 
now tell me the value of req.respnoseText
 
6:57 PM
that is the actual value of
var x = JSON.parse(req.responseText);
x ={"[{"0":1,"1":"qwdqwdq"}]"}
maybe i should parse it in a different way ?
 
what do you actually want?
 
i wanted to be like this
x= [{"0":1,"1":"qwdqwdq"}]
it's like this on the backend
 
this is x ={"[{"0":1,"1":"qwdqwdq"}]"} not possible
alert the value of x and tell me
in the backend what are you using?
 
Flask python
 
did you do jsonify() the data?
I acutally have no idea about python
ask javascript
 
7:01 PM
alert(x) results == > [object Object]
 
now do alert(JSON.stringify(x))
 
@weegee yes i did jsonify ( data ) on backend
{"[{\"0\":1,\"1\":\"qwdqwdq\"}]"}
that is the result from "alert(JSON.stringify(x))"
 
okay do JSON.parse(x)
and then you want the values 1 and qwdqwdq right?
 
@weegee yes !!!! JSON.parse(x) that worked !!
@weegee yea i think it would be x[0]["1"] , right ?
 
try it
 
7:11 PM
yes it worked !!!!!!!!!!!!!!!
I love u man :D
 
:)
 
 
3 hours later…
10:23 PM
@faceless Thanks! Hopefully I stay ahead of the curve :)
 

« first day (3157 days earlier)      last day (1808 days later) »