Js leaves or refreshes the page to detect of and is compatible with FF IE Chrome

  • 2020-03-30 02:12:25
  • OfStack

<!DOCTYPE html>
  function closeIt()
    return "Any string value here forces a dialog box to n" + 
         "appear before closing the window.";
  window.onbeforeunload = closeIt;
  <a href="//www.jb51.net">Click here to navigate to 

FF,IE,Chrome compatible js leave or refresh page detection, the key part is to have a return

Related articles: