You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was programming the index.html page and I ran across an error where the return false in the $('form').submit(callback) did not actually stop the callback seen in this block:
For anyone else hitting this problem I remedied it by creating a helper method and attaching it to the button. Instead of using a form element I wrapped the "form" in a div element. the code below is what worked for me to complete the example:
I was having this issue too. Then realized I just needed to move script tags to the bottom, right before </body>. After doing that, the original chat example code works fine.
just write
$(document).ready(function () {
$('form').submit(function(){
socket.emit('chat message', $('#m').val());
$('#m').val('');
return false;
});
})
where we adding document ready function... now we can put script in head) hope helps)
Hi,
I was programming the index.html page and I ran across an error where the return false in the
$('form').submit(callback)
did not actually stop the callback seen in this block:For anyone else hitting this problem I remedied it by creating a helper method and attaching it to the button. Instead of using a form element I wrapped the "form" in a div element. the code below is what worked for me to complete the example:
The text was updated successfully, but these errors were encountered: