Answer the question
In order to leave comments, you need to log in
Execute js function before closing browser tab?
Such a situation is that you need to perform the function of displaying a pop-up window (the function itself works) before the user, being on the site, wants to leave it, i.e. closes the browser tab. How to catch this action? Are there similar solutions that worked in most popular browsers?
If there is no such solution, then tell me an option in solving this problem?
Answer the question
In order to leave comments, you need to log in
There is an onload window loading event and an onunload event that is called before the browser closes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question