10 Replies Latest reply on Jul 21, 2017 10:25 PM by WaldoGuru

    iFrame keeps breaking out

    WaldoGuru

      Hey guys,

       

      Every time I load my website, my iFrame keeps breaking out. This means that the iFrame enlarges to a full screen.

       

      I have a snippet of code in the HTML portion of my page now which seems to do the job.

       

       

      Code:

      <script type="text/javascript">

          window.onbeforeunload = function () {                     

               return "This will end your session";

          }

      </script>

       

      Although it seems to work fine in terms of keeping the URL from busting out of the iframe, it loads a prompt: This page is asking you to confirm that you want to leave - data you have entered may not be saved. If someone clicks "leave", the iFrame will enlarge to full screen. When someone clicks "stay", the iFrame will remain as is and not enlarge (this is what I want).

       

      If anyone knows how I can stop this from occurring I would really appreciate your thoughts. Is there any way for it to automatically s"stay"?

       

      Many thanks in advance for any tips you can offer. Not positive, but I think it might be the onbeforeunload which is causing it.