6
6
666Wolf6662016-07-25 17:36:10
JavaScript
666Wolf666, 2016-07-25 17:36:10

Leaving a page does not work in Mozilla, are there alternatives?

Essence of the question:
There is a landing, if a person has not left any information about himself, when he tries to close the browser tab, a message is displayed, whether he definitely wants to leave and is invited to subscribe to the newsletter.
Implemented like this:

window.addEventListener("beforeunload", function(event){
        if($("#ok_out").val() == 0){
            $('#leave').modal();
            event.returnValue = "";
        }

But the problem is that in Mozille - this will not work. The customer uses it and claims that he saw such a feature on another site.
I decided to track when the user leaves the window area, but here the customer was also not satisfied, since you can easily close the tab and not pay attention to the modal.
Maybe someone came across and solved this problem. I will be grateful.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Goryachev, 2016-07-25
@webirus

I would cut off my hands

M
Mikhail Osher, 2016-07-25
@miraage

https://developer.mozilla.org/en-US/docs/Web/Event...
https://habrahabr.ru/post/141793/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question