打破我有下面的代码片段,其按预期工作:onclick事件在IE8
<a href="http://google.com" onclick="return false;">Will go to google</a>
点击HREF不带我去谷歌。
但是......如果我有JQuery的1.4和电线了现场点击事件任何在页面上(无论其是否存在不)此无关的事件处理程序停止按预期在IE(工作和继续工作在Firefox和铬)。返回false将被忽略,而点击链接会将您带到谷歌。
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function() {
$(".not-here").live("click", function() {alert("hi"); return false; });
});
//]]>
</script>
怎么回事?我是否遇到过JQuery 1.4版本中的错误?
这花了我的时间:2小时昨天离开,我不想让其他人失去这两个小时。 – 2010-01-25 22:25:00