AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Close tab browser javascript2/6/2024 All browser makers (basically chrome and firefox) have been clear that they do not allow that distinction. Also, you don’t need jQuery for your test, you can simply put the code in LeavePageQuestion() outside of the function.īasically it is unfortunately established that it is impossible to detect when the user closes a tab or the browser versus when the user hits refresh or simply navigates or changes the parameters.You could use that and remove your session. You could use async ajax, but it’s deprecated. 1,260 Points Answers 0 Sign in to vote User940174373 posted Nick (NC01) has a solution to detect the close event. In other words, how to show confirm box before closing or. It may appear to work at times, but it doesn’t because the unload event terminates all ajax requests and you can’t block it. Filter Sort by: Recently Active Newest First Oldest First 0 0 Hi Luca, mmmhhh right I have used Firefox but Chrome detect refresh. In this shorts, I've shown you How to Detect Browser or Tab Closing in JavaScript.
0 Comments
Read More
Leave a Reply. |