Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the usage of onpageshow event in JavaScript?
The onpageshow event triggers in JavaScript when a user reaches the new web page.
Example
You can try to run the following code to learn how to implement onpageshow event in JavaScript.
<!DOCTYPE html>
<html>
<body onpageshow = "newFunc()">
<p>On first visit, a welcome message is visible.</p>
<script>
function newFunc() {
alert("Welcome!");
}
</script>
</body>
</html>Advertisements