This解决方案不适用于IE9。使用Internet Explorer 9单击元素时未调用`onclick`事件
我有以下代码:
$(document).ready(function() {
document.getElementById('unsubref').onclick = function() {unsubcribe();};
});
和unsubref是:
<div id="unsub">
<h1>Click <a id="unsubref">here</a> to unsubscribe from the mailing service</h1>
</div>
在Chrome中,它工作得很好。正在使用警报调用功能unsubscribe
。
但是,在IE9中它不起作用!
后的代码'退订()'功能。 –
适用于我的IE(7-9)。另外我不明白为什么在使用jQuery的时候,你会想要使用attribute-event-handlers或者甚至是'getElementById'? – Yoshi
@Yoshi - 我该如何使用别的东西呢? – Dejell