Browser/Tab Closed... yes, again. :-)

Answered
0
0

Hi.

Please, don’t shout at me… but is there, currently, any way to find out if a Browser/Tab has been closed? I don’t mind if I get the same signal when the user refreshes or navigates or change the URL. I have tried the “onunload” and “onbeforeunload” javascript but none seem to work anymore. I don’t mind to recurrently check if a browser is still available or something like that. If not possible anymore, please, the phone number of the browser owned people who decided to have it working this way would be appreciated. ūüôā

Thanks in advance.

Ivan

  • You must to post comments
Best Answer
0
0

There is no way for a closed tab or browser to send a message back to the server. And there is no difference in any browser between navigating, refreshing, editing the url, or closing¬† the tab or closing the browser. All you can do is show an alert and you can’t even control the text and it doesn’t work all the times. You can use¬†Wisej.Web.Application.EnableUnloadConfirmation = true.

On the client you can use

Wisej.onLoad = function() {

   Wisej.onBeforeUnload = function() {

    // your js code

  };

   Wisej.onUnload = function() {

    // your js code

 };

}

But¬†safari on iOS doesn’t fire either one. Basically there is no guarantee it ever works. That’s just the way it is and there is no way around it.

 

  • You must to post comments
0
0

Hi Luca.

Thank you for your patience.

Yep, I had found out the Wisej.Web.Application.EnableUnloadConfirmation, but that doesn’t give me a chance to trigger any code in the server.
Regarding the JS code, is it possible to call a Method in the Server from the function() code?

Cheers.

Ivan

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.