0
J'essaie d'envoyer une notification si le socket est reçu.Erreur: événement "erreur" non spécifié et non spécifié. ([object Object])
côté serveur:
if(data.handle.length > 0 && data.message.length > 0){
io.sockets.emit('chat', data);
} else {
socket.emit('error');
}
côté client:
socket.on('error', function(){
$.amaran({
'theme' :'colorful',
'content' :{
bgcolor:'red',
color:'#fff',
message:'Please enter your name, and message and try again.'
},
'position' :'top right',
'outEffect' :'slideBottom'
});
});