I gave a talk about Comet and its future during AjaxWorld, in New York City. I talked about some shortcuts of current solutions including connection limits. Some solutions use a separate “channel” per window to receive updates from the server. Some are done a bit more elegant and some aren’t. But basically you have several connections from the browser to the server, no matter if they do concurrent long-polling or a fallback to periodic polling.
first page, that has the window id “w1″:
window.name = 'w1';
changeWindow = function()
var w2 = window.open("", 'w2',
if(w2.FOO != undefined)
<button onclick="changeWindow();">change window 2</button>
second page with window id “w2″:
window.name = 'w2';
Pusher.prototype.pushData = function(data)
document.getElementById("divToChange").innerHTML = data;
var FOO = new Pusher();
Now deploy these two pages on an HTTP server, like Apache httpd (it does not work locally – due to security) and open both. Best would be page1 in one Firefox window and page2 in another Firefox window. By having different windows you can easily observe the changed HTML later on…
So some may now think that is kinda hacky, well yes, but it works. However, the good news is that in HTML5 there will be a more standard solution to have cross-window-communication possible. Interesting future. For comet and web-developement!