S
S
SergOdinokiy2019-11-12 02:04:30
Node.js
SergOdinokiy, 2019-11-12 02:04:30

How to pass object from node.js server?

How to correctly transfer an object from the server?
I'm trying this: an error pops up How to do it right? ws.send({'connected':25,"room":1000});Q4AAKcRpyIU.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-11-12
@SergOdinokiy

Learn English, the error message says:
Which can be translated something like this:
Thus, in order to transfer JSON, it must be converted to a string representation:

ws.send( JSON.stringify({'connected':25,"room":1000}));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question