Guest User

Untitled

a guest
Apr 25th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 ws.onmessage = function(e) {
  2.                     timeout = setTimeout(function() {
  3.                         setDemoMessageError(id, "Message timeout, try again...");
  4.                     }, 10000);
  5.                     if (e.data != null) {
  6.                         if (JSON.parse(e.data)['STATUS'] == "SUCCESS") {
  7.                             executeChatUpdate(id);
  8.                         }
  9.                         else {
  10.                             setDemoMessageError(id, "Server has rejected your message");
  11.                         }
  12.                         console.log("timeout");
  13.                         clearTimeout(timeout);
  14.                     }
  15.                 }
Advertisement
Add Comment
Please, Sign In to add comment