jQuery – hashchange event
You can detect if the browser supports the event by: if (“onhashchange” in window) { //… } See also: Detecting event support without browser sniffing Emulating onhashchange without setInterval window.onhashchange
You can detect if the browser supports the event by: if (“onhashchange” in window) { //… } See also: Detecting event support without browser sniffing Emulating onhashchange without setInterval window.onhashchange
location.replace(“#hash_value_here”); worked fine for me until I found that it doesn’t work on IOS Chrome. In which case, use: history.replaceState(undefined, undefined, “#hash_value”) history.replaceState() operates exactly like history.pushState() except that replaceState() modifies the current history entry instead of creating a new one. Remember to keep the # or the last part of the url will be … Read more