Skip to content

Commit

Permalink
trying to fix the problem with undefines array
Browse files Browse the repository at this point in the history
  • Loading branch information
jettro committed Apr 6, 2011
1 parent 876f194 commit 1f4197a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
35 changes: 20 additions & 15 deletions public/javascript/socket-connect.js
Expand Up @@ -7,21 +7,26 @@ function sendMessage() {
$("#newMessage").val("");
}

now.receiveMessage = function(name, message) {
writeMessage(name + ": " + message);
};
$(document).ready(function() {

now.newlyJoined = function(name) {
writeMessage(name + " Joined");
};
now.receiveMessage = function(name, message) {
writeMessage(name + ": " + message);
};

now.hasLeft = function(name) {
writeMessage(name + " Left");
};
now.newlyJoined = function(name) {
writeMessage(name + " Joined");
};

now.refreshPersonsList = function() {
$(".person").remove();
for (var i = 0; i < now.availablePersons.length; i++) {
$("#availablePersons").append("<div class='person'>" + now.availablePersons[i] + "</div>");
}
};
now.hasLeft = function(name) {
writeMessage(name + " Left");
};

now.refreshPersonsList = function() {
$(".person").remove();
for (var i = 0; i < now.availablePersons.length; i++) {
$("#availablePersons").append("<div class='person'>" + now.availablePersons[i] + "</div>");
}
};

now.name = prompt("What's your name?", "")
});
4 changes: 0 additions & 4 deletions views/blog.jade
Expand Up @@ -6,10 +6,6 @@ html(lang="en")
script(src='/javascript/jquery-1.5.2.min.js')
script(src='/nowjs/now.js')
script(src='/javascript/socket-connect.js')
script(type='text/javascript')
$(document).ready(function() {
now.name = prompt("What's your name?", "")
});
body
div#message
div#body
Expand Down

0 comments on commit 1f4197a

Please sign in to comment.