Socket.io: Issue with sample chat app

Created on 1 Aug 2016  路  3Comments  路  Source: socketio/socket.io

While working through the sample at http://socket.io/get-started/chat/ I ran into some problems with jQuery handlers not firing.

I eventually traced it to not having $(document).ready(...) around the Javascript code.

e.g.

$( document ).ready(function() {
    $('form').submit(...
});

My recommendation is that $(document).ready() be aded to the source, as this may have tripped up other people as well.

Thanks,

-- Doug

Closed due to inactivity

Most helpful comment

Thanks, the same here.

Btw, you can also add the $('form').submit( thing just before the closing body tag.

All 3 comments

Thank you. I was driving myself crazy trying to figure out why it wasn't working.

Thanks, the same here.

Btw, you can also add the $('form').submit( thing just before the closing body tag.

That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).

Was this page helpful?
0 / 5 - 0 ratings