Displaying message if change in custom panel app

Shyam Kishore, modified 6 Years ago. New Member Posts: 3 Join Date: 4/14/17 Recent Posts
Hi, 

I am trying to display a message if the user has made some changes in the panel app page and does not save the changes and trying to redirect to some other page.

I tried with window. onbeforeunload it is not working properly.
<script>
   window.onbeforeunload = function() {
      return "Do you really want to leave our application?";
   };
</script>


I tried to inspect element on the page. I found the source was not getting with the changing the panel app to some other page.