Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html set name chatapp

const room = 'waiting';
      const socket = io('/tech');
      $('form').submit(() => {
        let msg = $('#m').val();
        socket.emit('message', { msg, room });
        $('#m').val('');
        return false;
      });

      socket.on('connect', () => {
        // emiting to everybody
        socket.emit('join', { room: room });
      })

      socket.on('message', (msg) => {
        $('#messages').append($('<li>').text(name + msg));
      })
Comment

PREVIOUS NEXT
Code Example
Html :: self closing tag html 
Html :: input date de naissance 
Html :: a pint of sap from a 4000 year old bristlecone pine 
Html :: font awesome free cdn 
Html :: couleurs html 
Html :: html 2d table 
Html :: redirect user when want to access html page 
Html :: terminal command to add data at first in all lines 
Html :: lightning-textarea size 
Html :: Laravel get the data and display it in the blade html failed 
Html :: how to email 
Html :: read_html pandas skiprows function example 
Html :: angular template driven debugeer html form 
Html :: html mobile does not show pdf with object 
Html :: why html 
Html :: bootstrap centred modal 
Html :: keyboard accessible buttons on navbar 
Html :: html insert html snippets 
Html :: html select subselect 
Html :: submit form include input type submit 
Html :: best meta tags 
Html :: html character encoding examples 
Html :: href seo 
Html :: bulma file upload 
Css :: css line-clamp 
Css :: overflow dots css 
Css :: how to contain an image within a div 
Css :: vertically and horizontally center a fixed div 
Css :: how to center a div in css 
Css :: textview android text align center 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =