I am passing data between ajax communications and it is basically a chat message. What I would like to know is how to prepare the data using javascript
for transfer to the backend. They might post links and characters.
Something like urlEncode?
I am passing data between ajax communications and it is basically a chat message. What I would like to know is how to prepare the data using javascript
for transfer to the backend. They might post links and characters.
Something like urlEncode?
encodeURIComponent
would be the right method to prepare it for transfer via HTTP.
For further description of the method, see f.e. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent