I have some code (written by another developer) that is doing AJAX page loading inside of WordPress (e.g. no page reloads) when you click a nav item, AJAX refreshes the primary
attachEvent takes on two params:
bSuccess = object.attachEvent(sEvent, fpNotify)
[And is needed for all versions of IE below IE9! :( See MDN reference ]
This could work:
if(window.addEventListener) {
window.addEventListener("hashchange", hashChange, false);
}
else if (window.attachEvent) {
window.attachEvent("onhashchange", hashchange);//SEE HERE...
//missed the on. Fixed thanks to @Robs answer.
}
Of course if it is possible, you should just use JQuery, since it encapsulates all this for your.
And as always there is a plugin out there: http://benalman.com/projects/jquery-hashchange-plugin/