Skip to content

Instantly share code, notes, and snippets.

@devdays
Created November 30, 2014 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devdays/a5989143e7ffb03af046 to your computer and use it in GitHub Desktop.
Save devdays/a5989143e7ffb03af046 to your computer and use it in GitHub Desktop.
Add event listeners for Web Sockets
websocket.onopen = function (evt) { onOpen(evt) };
websocket.onclose = function (evt) { onClose(evt) };
websocket.onmessage = function (evt) { onMessage(evt) };
websocket.onerror = function (evt) { onError(evt) };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment