I want to give you an alert when the user goes back in the web browser.
How can I detect it when I go backwards?
html5 jquery javascript
I solved it as below.
window.onbeforeunload = function(e) {
if ($('.form').val()) {
There is a post that is being created 'return'.';
}
};
If you try to leave the page while you are creating in the form, an alert appears.
© 2024 OneMinuteCode. All rights reserved.