onafterprint 이벤트
예시
페이지 인쇄가 시작되면 JavaScript 실행:
<body onafterprint="myFunction()">
정의 및 사용
onafterprint 이벤트는 페이지가 인쇄를 시작하거나 인쇄 대화 상자가 닫힌 경우 발생합니다.
팁: onafterprint 이벤트는 onbeforeprint 이벤트의 반대입니다.
브라우저 지원
Event | |||||
---|---|---|---|---|---|
onafterprint | 63 | Yes | Yes | Not supported | Not supported |
통사론
HTML:
<element onafterprint="myScript">
자바스크립트:
object.onafterprint = function(){myScript};
JavaScript에서 addEventListener() 메서드를 사용하여 다음을 수행합니다.
object.addEventListener("afterprint", myScript);
참고: addEventListener () 메서드는 Internet Explorer 8 및 이전 버전에서 지원되지 않습니다.
기술적 세부 사항
거품: | 아니 |
---|---|
취소 가능: | 아니 |
이벤트 유형: | 이벤트 |
지원되는 HTML 태그: | <본체> |
DOM 버전: | 레벨 3 이벤트 |