Javascript Alert Pop up Box For Accidental Navigation / Close

| Written by: james


Table of Contents:

    Here's an easy javascript alert pop up box / warning box if you accidentally close or leave the current tab

    javascript close warning pop up code script

    You have your moments that you accidentally close a tab and boom all you work has gone into thin air. As a programmer this is a pain in the ass. But worry no more, today I'll show to you the most effective yet very easy javascript code that you can easily copy and paste on your own own source code. A code that will save you! 

    Uses

    A simple javascript code that will give you warning if you accidentally close/leave a tab you currently in.

    That you can use on your marketing needs and don't let your customers leave you site!

    For programming needs that you dont want users to accidentally close the tab.

    Code

    Demo

     

    How to use?

    Simply copy the code above and paste anywhere on your source code that you want to show the warning pop up box. Preferrable inside the body tag.

    Author: james
    Created Date: May 30, 2020
    Updated Date: May 30, 2020