onpageshow 이벤트는 사용자가 새 웹 페이지에 도달할 때 JavaScript에서 트리거됩니다.
예시
다음 코드를 실행하여 JavaScript에서 onpageshow 이벤트를 구현하는 방법을 배울 수 있습니다.
<!DOCTYPE html>
<html>
<body onpageshow = "newFunc()">
<p>On first visit, a welcome message is visible.</p>
<script>
function newFunc() {
alert("Welcome!");
}
</script>
</body>
</html>