JavaScript: URI capture

I have a website where I use hash based parameters, for example.

http://url.of.site/#param1=123

What I want

When the user manually changes the URI, for example.

http://url.of.site/#param1=789

When the user enters this URI, the event is captured by JavaScript, and the corresponding functions are called. Basically, I wonder if there is an event listener for this? Or do I need to check the URI periodically to see if it has changed?

I already use the current jQuery API if this helps.

_L

+3
source share
1 answer
+2
source

Source: https://habr.com/ru/post/1745469/


All Articles