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:
onhashchange
without setIntervalwindow.onhashchange