-1

I want to display a confirmation popup "Do you want to refresh this page" once user clicks "refresh". If user selects yes in popup, then page should refresh otherwise it should stay as is.

Thanks

Tal
  • 1,091
  • 12
  • 25

2 Answers2

3

you could use this javascript code to check page refresh.

window.onbeforeunload = function(){
return "Do you want to refresh this page";
};
0

I did this and it worked

  window.onbeforeunload = 
     function(){
       return "Refreshing page will result in loss of data, do you want to continue ?";
     };
Tal
  • 1,091
  • 12
  • 25