oLink = document.getElementById("ItemDescend");
alert(oLink); // fire up alert with link target
addEventHandler(oLink, "click", function(e) { alert(1); sortTable('theList', 0, true); preventDefault(e); },false); // does not fire up inner alert!
This above code functions in all other browsers as tested, but in Chrome 12 does not. I would be grateful if someone shows me a solution. Thanks.
Your
addEventHandlermethod is checking for an unrelated property, which is wrong.Instead, you should check for the
addEventListenermethod, and only callattachEventif that doesn’t exist.Change the condition to