Answer the question
In order to leave comments, you need to log in
How to constantly receive data from a socket?
Good afternoon, I understand that it is not clear from the name what I need, I will try to describe.
there are 3 sides Playlist.html -> app.js ->
Playlist.html client sends to app,js playlist, client should get data from app.js when connecting.
Looks like this
Playlist.html socket.emit('songchanged', stringTableCur);
App.js
socket.on('songchanged', function(changed){
console.log(changed);
});
socket.emit('getSong');
socket.on('songchanged', function(changed){
socket.on('getSong, function(data){
emit...
})
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question