Jeff
unread,Feb 9, 2012, 2:08:19 PM2/9/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Socket.IO
Hey everyone,
I'm having a problem where if I use the onbeforeunload event and the
user opts to "stay on this page", it appears the connection to my
Node.js/Socket.IO server gets killed.
I'm using something similar to the code below so that when the client
receives the event "updateScript", it logs a message to the console.
Socket.on("updateScript", function(){
console.log('updateScript event received');
});
It works until you try to close the window, then choose "stay on this
page." After that, the event doesn't fire.
I'm having the problem in Chrome, Safari, and Firefox. I couldn't
replicate it in Opera, but I think that might be because it doesn't
support onbeforeunload. I didn't test Internet Explorer.
Any ideas?