【发布时间】:2012-01-18 10:16:17
【问题描述】:
This 解决方案不适用于 IE9。
我有以下代码:
$(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 中它不起作用!
【问题讨论】:
-
贴出
unsubscribe()函数的代码。 -
在我的 IE (7-9) 中工作。我也不明白为什么,在使用 jQuery 时,你会想要使用属性事件处理程序甚至
getElementById? -
@Yoshi - 我怎样才能使用别的东西呢?
-
见@DarinDimitrov 的回答。 ;)
标签: javascript html jquery internet-explorer-9 jquery-events