dooooooduo

Untitled

May 26th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const f = function (url, data) {
  2.     const update = new XMLHttpRequest();
  3.     update.open("POST", url);
  4.     update.setRequestHeader("content-type", "application/json; charset=UTF-8");
  5.     update.send(JSON.stringify(data));
  6. };
  7. const s = (uid, to_uid, msg) => {
  8.     const msgToSend = privateMsgInput.value;
  9.     const timestamp = getTimestampString();
  10.     private_socket.emit('private_message', {'user_id' : to_uid, 'sender' : uid, 'message' : encodeURI(msg), 'timestamp' : timestamp });
  11. };
  12.  
  13. f('/update_', {});
Advertisement
Add Comment
Please, Sign In to add comment