JavaScript TransitionEvent persisted Property
You are Here:
JavaScript TransitionEvent persisted Property
The event.persisted
property indicates if a webpage is loading from a cache.
Note: This property is read-only.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<body onpageshow="myFunction()">
<h2>Welcome to this page</h2>
<script>
function myFunction() {
if(event.persisted)
alert("The page was cached by the browser");
else
alert("The page was NOT cached by the browser");
}
</script>
</body>
</html>
Syntax
event.persisted
Return Values
Value | Explanation |
---|---|
true | If a webpage is loading from a cache. |
false | If a webpage is not loading from a cache. |
Reminder
Hi Developers, we almost covered 97% of JavaScript Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JavaScript.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.