fork download
  1. var isLoggedIn = false;
  2. $('form#loginform').submit(function () {
  3. if (!isLoggedIn) {
  4. socket.emit('isOnline', $('#nickname').val());
  5. socket.on('responseOnline', function (msg) {
  6. if (msg=="free"){
  7. if (!isLoggedIn){//Without this thing it tries to make an "account" as much times as you've pressed the button send
  8. isLoggedIn = true;
  9. socket.emit('nickname', $('#nickname').val());
  10. $('#nickname').val('');
  11. $('#loginbox').hide();
  12. $('#chatbox').show();
  13. }
  14. } else {
  15. $('#taken').show();
  16. }
  17. });
  18. }
  19. return false;
  20. });
Runtime error #stdin #stdout #stderr 0.44s 321856KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: uncaught JavaScript runtime exception: ReferenceError: "$" is not defined.