I need a way to append some parameters in the URL as soon as the user clicks on refresh or he does hard refresh. For example, if the website URL is http://localhost:3000/search/friends?action=friends&controller=users&abc=true&user_type=All
I need to append a string &str="123" just after the user clicks on refresh.
beforeunload event will fire as soon as I click on the refresh. When I am trying to append parameter in the URL it isn't working for me
$(window).on('beforeunload', function() {
//append &str="123" on refresh
});
I went through few posts on SO but none of it worked for me