I have a problem because I need to detect when my URL change and I don't find the solution. I have seen "window.onhashchange" but that is only for URL that contain "#" symbol. In my case, I dont have in my URL the Symbol "#" so for example, if my URL is "/myURL/oneOption" and change to "/myURL/secondOption" I need to detect that. Somebody know how can I to do that?
Im developping a Java application and Im using HTML, CSS and Javascript (frontend). My problem is that I need to know when I press refresh button. I tried many options like that:
if (window.performance) {
console.info("window.performance works fine on this browser");
}
if (performance.navigation.type == 1) {
console.info( "This page is reloaded" );
} else {
console.info( "This page is not reloaded");
}
When I run my application and refresh the page I always see "window.performance works fine on this browser" and "This page is not reloaded". So I thought that the best opcion was check if my mouse is in the page or not (document.onmouseover, document.onmouseleave) and detect when my URL changes and in that moment call a Java function for reload my session params and show the page. I don't know if is it the best option. If somebody could say me other way to do that will be really good for me!!
Thanks in advance.
Regards!!