Find out whether the page was cached by the browser:
function myFunction(event) {
alert(event.persisted);
}
Try it Yourself »
The persisted property returns a Boolean value that indicates if the webpage is loaded directly from the server, or if the page is cached, when an onpageshow or onpagehide event occurs.
This property is read-only.
event.persisted
Return Value: | A Boolean, indicating whether the webpage is loading from a cache. Possible values:
|
---|
HTML DOM reference: The onpageshow Event
event.persisted
is a DOM Level 3 (2004) feature.
It is fully supported in all modern browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 11 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!