--- miscJava/Test3/WebContent/WebsockTest.html 2014/02/11 12:44:13 2113
+++ miscJava/Test3/WebContent/WebsockTest.html 2014/02/11 12:49:11 2114
@@ -22,7 +22,10 @@
function sendMessage() {
try {
var txt = $("#txt").val();
+ txt = $.trim(txt);
//append(txt);
+ if (txt == "")
+ return;
socket.send( "CHAT#" + txt);
@@ -73,6 +76,11 @@
var nick = $("#nick").val();
nick = $.trim(nick);
+ if (nick == "") {
+ alert("Nick can not be empty");
+ return;
+ }
+
try {
socket.send( "NICK#" + nick);
} catch(exception) {