Eyeeshot BloG

Jquery beforeunload 본문

Tech/Css & Javascript

Jquery beforeunload

eyeeshot 2020. 12. 3. 12:05
  <html>
    <title>beforeunload test</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script>
        $(window).on('beforeunload', function () {
            return '본 영상은 10분 이상 학습하셔야 합니다. 정말로 종료하시겠습니까?'
        });

    </script>
    <body>

    </body>
</html>

 

* 크롬은 메시지 변화가 안된다.
dialog 메시지 관련해서의 크롬 정책은 찾을 수 있었고, 꽤 오래전부터 크롬에서 제한해온 것으로 확인했다.
https://www.chromestatus.com/feature/5349061406228480

'Tech > Css & Javascript' 카테고리의 다른 글

Let vs var vs const  (0) 2020.12.03
CSS Best Practice about ID and Class?  (0) 2020.10.05