Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ws.onmessage = function(e) {
- timeout = setTimeout(function() {
- setDemoMessageError(id, "Message timeout, try again...");
- }, 10000);
- if (e.data != null) {
- if (JSON.parse(e.data)['STATUS'] == "SUCCESS") {
- executeChatUpdate(id);
- }
- else {
- setDemoMessageError(id, "Server has rejected your message");
- }
- console.log("timeout");
- clearTimeout(timeout);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment