1

Tell me some url change events other than hashchange ? As i want to put a function on url change

"https://example.com/jobA" 

from

"https://example.com/contactus"

I search the url change event , but get only hashchange event, which is limited to # change.

Asterisk
  • 129
  • 1
  • 11
  • 1
    Possible duplicate of [Event when window.location.href changes](https://stackoverflow.com/questions/3522090/event-when-window-location-href-changes) – Ivar Oct 11 '17 at 10:15
  • 1
    How will this url be changing? If you are using `history` API to change url then you can use `onpopstate` event. – Mohit Bhardwaj Oct 11 '17 at 10:16
  • i'll check @mohit – Asterisk Oct 11 '17 at 11:01
  • @ivar the answers are same, but the question originates differently. – Asterisk Oct 11 '17 at 14:04
  • @Asterisk In the end, you are both asking for an event that is fired when the url changes. And since the answers apply to both questions, there isn't really much additional value to leave this question open. Be aware though that having a question marked as duplicate [isn't a bad thing](https://stackoverflow.blog/2010/11/16/dr-strangedupe-or-how-i-learned-to-stop-worrying-and-love-duplication/) perse. – Ivar Oct 11 '17 at 14:11
  • In that question there is only one answer and it is 7 years old, i can get new answers as mine question is latest. If some more persons put more as duplicate, then i'll closed it. – Asterisk Oct 11 '17 at 14:24
  • 1
    That's not how Stack Overflow works. You don't want people with the same question have to go through several posts in order to find good answers. We like to have all good quality content at one place. The fact that it is a 7 year old question does not invalidate how it works. And even if it doesn't work, then a new answer should be added to that question, not an other one. – Ivar Oct 11 '17 at 14:35

0 Answers0