I am trying to check if the browser supports onHashChangeor not hide any code from it, if not, as follows:
if(window.onhashchange){
...code...
} else {
...other code...
}
I also tried:
if(typeof window.onhashchange === "function"){
alert("Supports");
} else {
alert("Doesn't Supports");
}
As described in Quirksmode , this should work, but if I do , for example, in , which warns me, but Safari does not support : S alerttrue stateSafarionHashChange
What is the problem? If I do not return, how can I check this?
source
share