Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const f = function (url, data) {
- const update = new XMLHttpRequest();
- update.open("POST", url);
- update.setRequestHeader("content-type", "application/json; charset=UTF-8");
- update.send(JSON.stringify(data));
- };
- const s = (uid, to_uid, msg) => {
- const msgToSend = privateMsgInput.value;
- const timestamp = getTimestampString();
- private_socket.emit('private_message', {'user_id' : to_uid, 'sender' : uid, 'message' : encodeURI(msg), 'timestamp' : timestamp });
- };
- f('/update_', {});
Advertisement
Add Comment
Please, Sign In to add comment