Run a function every time the url hash changes