Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Browser Close Event not working with out alert() Or Return message

$
0
0
I'm working on big product development , Client requirement is if  Client browser window or tab closed need to be logout from database for that client only.

 I'm using this script for capture browser close,Tab close event using jquery. It's working only when i'm put  alert(); or return stringmeans" return " ";  If i am not added any one these it is not working. In all browsers it's working  without alert() or return string but i'm facing this problem for only IE. I did checked on IE10,IE 9 also not working.

Am also tested on javascript "before unload event" not wokring for IE but working all browser.

Here's code

varCookieClientID="";varCookieUserID=""; $(window).unload(function(){}); $(window).bind("beforeunload",function(){ beforeunloadval++if(beforeunloadval ==1){var value = document.cookie.split('|');CookieClientID= value[7];CookieUserID= value[8];if(CookieClientID!=""||CookieUserID!=""||CookieClientID!=undefined||CookieUserID!=undefined){try{//BTGUI.WebServices.ConnectionToken.LogoutMethod(CookieClientID, CookieUserID, LogoutMethodSucess);if(Sys.Browser.name =="Microsoft Internet Explorer"){// debugger;Demo.WebServices.Demo.LogDemo(CookieClientID,CookieUserID,LogoutMethodSucess);//working only put alert() or return msg otherwise not working

alert('OK');}else{Demo.WebServices.Demo.LogDemo(CookieClientID,CookieUserID,LogoutMethodSucess);}}catch(e){ alert(e)}}}return;});

Thanks


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>