Permalink
Browse files

Trying other methods of catching connection.

  • Loading branch information...
1 parent 2407167 commit d427e4ae854a5a6f2db6256e42de77f521b744f7 @DanBUK DanBUK committed Feb 6, 2011
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);

0 comments on commit d427e4a

Please sign in to comment.