Answers for "js before unload"

1

js before unload

window.addEventListener('beforeunload', (event) => {
  // Cancel the event as stated by the standard.
  event.preventDefault();
  // Chrome requires returnValue to be set.
  event.returnValue = '';
});
Posted by: Guest on July-16-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language