Skip to content Skip to sidebar Skip to footer

OnBeforeUnload Suddenly Not Working As Expected

I was using this snippet for almost 2 years. It was fine then, until I saw it was not working today on Google Chrome version 51.0.2704.103m. $(window).on('beforeunload', function (

Solution 1:

Chrome from Version 51 onwards no longer supports custom messages on beforeunload.

A window’s onbeforeunload property may be set to a function that returns a string that is shown to the user in a dialog box to confirm that the user wants to navigate away. This was intended to prevent users from losing data during navigation. Unfortunately, it is often used to scam users.

Details here


Post a Comment for "OnBeforeUnload Suddenly Not Working As Expected"