A handler of hashchange event that supports almost all browsers.