Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

JS how to determine if page was cached

// https://developer.mozilla.org/en-US/docs/Web/API/PageTransitionEvent
window.addEventListener('pageshow', myFunction);

function myFunction(event) { 
  if (event.persisted) {
    alert("The page was cached by the browser");
  } else {
    alert("The page was NOT cached by the browser");
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: eliminar comillas de un string javascript 
Javascript :: css vw not working on mobile 
Javascript :: get all date between two dates in javascript 
Javascript :: how to watch for changes within a prop in vue 
Javascript :: javascript max 
Javascript :: async function 
Javascript :: reverse each word in string javascript without using inbuilt function 
Javascript :: what is side effect 
Javascript :: uppercase first letter javascript 
Javascript :: convert json into map in java example 
Javascript :: jquery check is select 
Javascript :: react key press hook 
Javascript :: javascript map 
Javascript :: ajouter javascript dans html 
Javascript :: react-loader-spinner 
Javascript :: how to include js file in react 
Javascript :: Material-ui add circle outline icon 
Javascript :: bcrypt 
Javascript :: hello world in javascript 
Javascript :: react spring 
Javascript :: get input js 
Javascript :: at leastone checkbox required jquery 
Javascript :: jquery data 
Javascript :: see all set variables chrome 
Javascript :: hashtable js 
Javascript :: js string interpolation 
Javascript :: call multiple functions onclick react 
Javascript :: try and catch express 
Javascript :: react load script after render 
Javascript :: destructuring objects 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =