mercredi 27 octobre 2021

Warn web user if the back button was pressed using javascript

Hi I tried to use the following javascript to warn users.

 window.onbeforeunload = function() {
       return "Are you sure you wish to leave?";
    };

But I need to make sure that the back button is pressed it seems to call this when you change the url.

Thanks




Aucun commentaire:

Enregistrer un commentaire