I had some research regarding how to subscribe in the event when back button of the browser is clicked but unfortunately I wasn't able to find the right answer for my problem
I tried doing this:
var $window = $(window);
$window.on('beforeunload', function()
{
commitFieldChanges();
});
i used require JS for this
and the other solution for this is
$(window).bind('beforeunload', function(){
return '';
});
However all of this is not working because my application is a single page app. So the page is not really loading when back button is clicked because we use # to navigate in the application in the URL so what do you think guys? Any suggestion for my problem?