Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

socket.io client send data node js server

var socket = io.connect('http://localhost');
socket.emit('my other event', { my: 'data' });
//server side
io.sockets.on('connection', function (socket) {
  socket.on('my other event', function (data) {
    console.log(data);
  });
});
//sending data from the user via a socket.io
socket.on("test", function (data) {
    data.forEach(obj => {
        console.log("Yer : " + obj.yer + ", Lat : " + obj.lat + ", Long : " + obj.lng);
    })
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: nepali date picker 
Javascript :: react slick 
Javascript :: Easy REACT download image 
Javascript :: javascript set input value 
Javascript :: js + before variable 
Javascript :: node app 
Javascript :: nextjs global scss variables 
Javascript :: mysql remove quote on json extract 
Javascript :: js json data undefined 
Javascript :: laravel http send data json raw 
Javascript :: how to show progress on ajax call 
Javascript :: loading 
Javascript :: alphabet to number javascript 
Javascript :: is function javascript 
Javascript :: get first duv with jquery 
Javascript :: paper material ui 
Javascript :: can you call a function within a function javascript 
Javascript :: js bubble sort 
Javascript :: express post method 
Javascript :: starting express server 
Javascript :: react scroll to bottom 
Javascript :: react render after fetch 
Javascript :: js console log multiple 
Javascript :: react blur background 
Javascript :: javascript date to string format dd mmm yyyy 
Javascript :: usereducer hook 
Javascript :: set input value vanilla js 
Javascript :: json stringify double quotes 
Javascript :: mongodb replace root 
Javascript :: reactjs node sass incompatible with ^4.0.0 ^5.0.0 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =