5
在socket.io,可以綁定到這樣的插座事件/通道:你如何停止收聽socket.io頻道?
<script src="/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://localhost');
socket.on('news', function (data) {
console.log(data);
socket.emit('my other event', { my: 'data' });
});
</script>
但是你如何停止收聽「新聞」事件?
看看這個的answere http://stackoverflow.com/questions/9418697/how-to-unsubscribe-from-a-socket-io-subscription –