2 Replies Latest reply on Feb 26, 2014 8:42 AM by BruceHerbach

    OnLastWindowClose in WebDirect


      When a user of a WebDirect site closes his browser or goes to another site, will the OnLastWindowClose script trigger be fired?


      This would make it possible to log him out properly and even do some other stuff, like registering when this happened.

        • 1. Re: OnLastWindowClose in WebDirect
          Mike Duncan

          I don't know if this is possible, and would certainly not be reliable. As far as I know, javascript to capture closing a browser window is only possible with windows that you spawned and named, so a user entering a webdirect session would not necessarilly be under those circumstances.


          Also, as you point out, they might just type in a different URL to go to. In that case, it might be possible with some tricks to capture if they're leaving the page, but I would be hesitant to introduce that kind of behavior in my web apps, I think. They usually involve some iframe or hidden divs or something, and still are not a reliable means of doing what you want.


          Webdirect seems to at least try to stick to html5 standards, which is probably a good decision in terms of cross platform/browser support they're trying to get to.

          • 2. Re: OnLastWindowClose in WebDirect



            Unfortunatly the closing the browser does not run the OnLastWindowClose script.  The user has to click a button or logout.  I believe that an official logout does run the script.




            1 of 1 people found this helpful