chat example: use .on instead of submit

This commit is contained in:
Tony Miller 2013-02-18 23:42:31 -08:00
parent 74b301268b
commit ca5cd68ab5
1 changed files with 1 additions and 1 deletions

View File

@ -49,7 +49,7 @@ __END__
es.onmessage = function(e) { $('#chat').append(e.data + "\n") };
// writing
$("form").submit(function(e) {
$("form").on('submit',function(e) {
$.post('/', {msg: "<%= user %>: " + $('#msg').val()});
$('#msg').val(''); $('#msg').focus();
e.preventDefault();