Note
Solution should be in pure Javascript - No external library and frameworks.
In SPA, Everything gets routed using routing mechanism. I just want to listen to an even whenever any part of url changes (Not only hash. Any change I want to detect)
Following is example of SPA,
https://www.google.in/
https://www.google.in/women
https://www.google.in/girl
Now whenever url changes from https://www.hopscotch.in/ to https://www.hopscotch.in/women, I want to capture that event.
I tried,
window.addEventListener("hashchange",function(event){
console.log(this); // this gets fired only when hash changes
});