0

I am trying to do this in html and js but not refresh or reload just trigger when its getting closed. I used functions like onbeforeunload,unload but they didnt work.
sample image

1

1 Answer 1

1

Try This with jQuery:

$(window).bind('beforeunload', function(){ return 'Are you sure you want to leave?'; }); 

Or with javascript

window.onbeforeunload = function(){ return 'Are you sure you want to leave?'; }; 
Sign up to request clarification or add additional context in comments.

Comments