Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Trying other methods of catching connection.

  • Loading branch information...
commit d427e4ae854a5a6f2db6256e42de77f521b744f7 1 parent 2407167
@DanBUK authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 public/index.html
View
5 public/index.html
@@ -37,9 +37,7 @@
var body_loaded = function () {
sock = new io.Socket();
sock.on('message', handleMessage);
- sock.on('connection', alert('connection'));
- sock.on('connect', alert('connect'));
- sock.connect(function () {
+ sock.on('connection', function () {
// ts = document.getElementById('timestamp');
var name = prompt("Please enter your nickname:", "");
switch (name) {
@@ -56,6 +54,7 @@
break;
}
});
+ sock.connect();
};
var handleMessage = function (data) {
var obj = JSON.parse(data);
Please sign in to comment.
Something went wrong with that request. Please try again.