Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript show popup on page refresh unsaved changes

var onReloadCheck = function () {
        $(window).on('beforeunload', function () {
            var modal = $('#myModal').hasClass('show');
            if (modal) {
                return "If you leave before saving, your changes will be lost.";
            }
        });
    }
 
PREVIOUS NEXT
Tagged: #javascript #show #popup #page #refresh #unsaved
ADD COMMENT
Topic
Name
7+3 =