"HTML DOM beforeunload 이벤트"의 두 판 사이의 차이

잔글 (Jmnote님이 Beforeunload 문서를 HTML DOM beforeunload 이벤트 문서로 이동했습니다)
 
(같은 사용자의 중간 판 5개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
==개요==
;beforeunload 이벤트
;beforeunload 이벤트
;이 사이트에서 나가시겠습니까?


<source lang='html'>
<source lang='html'>
13번째 줄: 14번째 줄:


==브라우저 경고창 예시==
==브라우저 경고창 예시==
{{소스헤더|크롬}}
[[File:Chrome - 이 사이트에서 나가시겠습니까.png]]
[[File:Chrome - 이 사이트에서 나가시겠습니까.png]]


==같이 보기==
==같이 보기==
* [[jQuery textarea 저장하지 않고 페이지 이동시 경고]]
* [[WindowEventHandlers.onbeforeunload]]
* [[DOMContentLoaded]]
* [[DOMContentLoaded]]
* [[readystatechange]]
* [[readystatechange]]

2018년 3월 5일 (월) 00:12 기준 최신판

1 개요[ | ]

beforeunload 이벤트
이 사이트에서 나가시겠습니까?
<script>
window.addEventListener("beforeunload", function (e) {
  var confirmationMessage = "\o/";
  e.returnValue = confirmationMessage; // Gecko, Trident, Chrome 34+
  return confirmationMessage; // Gecko, WebKit, Chrome <34
});
</script>

2 브라우저 경고창 예시[ | ]

크롬

Chrome - 이 사이트에서 나가시겠습니까.png

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}