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