First of all, hello everyone and thanks for your time.
I'm making an application with Jquery Mobile and I have a big problem. When a page is refreshed, all the dynamic content that has been generated from the page is obviously lost, leaving only the HTML template where the content has been generated dynamically.
What I am trying to do is that when the user tries to refresh the page, he asks if he really wants to do it, since all the information on the page will be lost, this is already implemented and he asks it when the user wants to refresh. the page.
But the problem comes when I try to redirect the page to the home page. It works correctly for Chrome, Firefox and Opera, but not for Internet Explorer and Safari ...
The code is simple:
window.onunload = function(e){
$.mobile.changePage("#login");
window.location.reload();
}
What I do in case of confirmation by the user that you want to refresh the page is to redirect it to the login and make a refresh, to "force" to load the entire document, because if I do not leave me operate all the handlers.
Well the fact is that this works well in these browsers but not in IE and Safari, it seems that IE ignores the redirection that I ask and directly reloads the page on which the user is , with the inconvenience of what was previously mentioned, the page is reloaded without any dynamic content.
Does anyone know why this may happen ?, Internet Explorer does not let you do any kind of redirect or something ?. I tried to do it through window.location, window.location.href and window.location.replace and nothing keeps reloading the page the user is currently on.
Any solution?
Thanks in advance.