onpageshow Event in JavaScript
onpageshow Event in JavaScript
The onpageshow event is used to occur when a user navigates to a webpage. It is like onload event. However, it occurs after the onload event when page first loads. Moreover, the onpageshow event occurs every time the page is loaded, whereas the onload event does not occur when page is loaded from cache.
For your Information:-
The persisted property is a read-only property that returns a Boolean value that indicates if webpage is loaded directly from server or is cached when an onpageshow or onpagehide event occurs.
Syntax:-
Its syntax is:- < anyElement onpageshow="my_script" > OR object.onpageshow= function(){my_script} OR object.addEventListener("pageshow", my_script)