|
Definition and UsageThe onpageshow event occurs when a user navigates to a webpage. The onpageshow event is similar to the onload event, except that it occurs after the onload event when the page first loads. Also, the onpageshow event occurs every time the page is loaded, whereas the onload event does not occur when the page is loaded from the cache. |
<body onpageshow="myFunction()">
The numbers in the table specify the first browser version that fully supports the event attribute.
<element onpageshow="script">
| Value | Description |
|---|---|
| script | The script to be run on onpageshow |
| Supported HTML tags: | <body> |
|---|
See the code.
<!DOCTYPE html>
<html>
<body onpageshow="myFunction()">
<h1>Hello World!</h1>
<script>
function myFunction() {
alert("Welcome!");
}
</script>
</body>
</html>
| html event attributes |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Window Event Attributes |
Uploaded by: | Admin |
Read Articlehttps://develop.horje.com/learn/1434/reference