<!DOCTYPE html>
<html>
<body onpageshow="myFunction()">

<h1>Hello World!</h1>

<p><strong>Note:</strong> The onpageshow event is not supported in Internet Explorer 10 and earlier versions.</p>

<script>
function myFunction() {
    alert("Welcome!");
}
</script>

</body>
</html>