I\'m interested in using the JavaScript hashchange event to monitor changes in the URL\'s fragment identifier. I\'m aware of Really Simple History and the jQuery plugins fo
Here is a modification of the answer provided by CMS, which doesn't contain a function in another, which I think would work:
function event_exists(eventName){
if(typeof(eventName)!='string' || eventName.length==0)return false;
var TAGNAMES = {
'select':'input','change':'input',
'submit':'form','reset':'form',
'error':'img','load':'img','abort':'img'
}
var el = document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
var isSupported = (eventName in el);
if (!isSupported) {
el.setAttribute(eventName,'return;');
isSupported = (typeof(el[eventName])=='function');
}
el = null;
return isSupported;
}