0

I am using window.onbeforeunload Java Script , for while you close the tab in Chrome need to show the pop up as Leave Page or Stay . But the window.onbeforeunload is working in IE and not working in the Chrome "Version 63.0.3239.132 ".

And i have attached my code below

window.onbeforeunload = function () {
   return "Hi";
 };
  • Works fine for me in Chrome: https://jsfiddle.net/a1vvo06z/ note that you have to right click in the result frame and choose 'reload frame' to see it working. Note that Chrome will only ask you to confirm leaving the page, it won't show `Hi`. There's nothing you can do about that – Rory McCrossan Jan 25 '18 at 10:18
  • As you send the link jsfiddle.net/a1vvo06z its working on first time , while we select an Leave means at next time the pop was not showing. Can u give some example that work in the Chrome @RoryMcCrossan – Arunkumar Vijayakumar Jan 25 '18 at 10:24

0 Answers0