I recommend using Source Source, unlike AJAX Comet, there is no open open connection, so you are much more capable of transferring more clients.
if (!!window.EventSource) {
var source = new EventSource('EventSource.php');
source.addEventListener('open', function(e) {
}, false);
source.addEventListener('error', function(e) {
if (e.readyState == EventSource.CLOSED) {
}
}, false);
source.addEventListener('message', function(e) {
}, false);
}
source
share