From: Florian Zeitz Date: Wed, 1 Dec 2010 19:34:13 +0000 (+0100) Subject: Fix disconnection on leaving the page X-Git-Url: https://cgit.babelmonkeys.de/?a=commitdiff_plain;h=e3f2eb03a5f4dc014e034cdfc65a572544421336;p=adhocweb.git Fix disconnection on leaving the page --- diff --git a/js/main.js b/js/main.js index 9e09865..188dfc7 100644 --- a/js/main.js +++ b/js/main.js @@ -339,9 +339,8 @@ $(document).ready(function () { }); }); -onunload = function() { +window.onunload = window.onbeforeunload = function() { if (connection) { connection.disconnect(); } } -