jQuery直播不在IE8中工作 [英] jQuery live not working in IE8

查看:127
本文介绍了jQuery直播不在IE8中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下适用于Firefox 3和IE 7但不适用于IE8。

The following works in Firefox 3 and IE 7 but not in IE8.

鉴于此HTML代码段:

Given this HTML snippet:

<li><a href="#" class="remove">remove me</a></li>

javascript:

javascript:

jQuery('.remove').live('click', function(e){
            jQuery(this).parent().remove();
        });

我希望我有一条错误消息可以使用,但我没有。

I wish I had an error message to work with but I don't.

如何让它在IE8中运行?

How can I get this to work in IE8?

我还应该提到锚标签正在由原型版本1.6.0生成。

I should also mention that the anchor tag is being generated by prototype version 1.6.0.

更新:这是Prototype 1.6.0中的一个错误,修复于1.6.1 参见问题

UPDATE: This is a bug in Prototype 1.6.0 and is fixed in 1.6.1 See Issue

推荐答案

正如我在问题中所提到的,锚标记由Prototype 1.6.0生成。这有一个错误,它将类属性生成为className而不仅仅是class。 jQuery无法识别className属性,因此我的代码示例失败。这被认为是Prototype中的一个错误问题跟踪系统并在1.6.1中修复。

As I mentioned in the question, the anchor tag is being generated by Prototype 1.6.0. This has a bug that generates the class attribute as "className" instead of just "class". jQuery does not recognize the "className" attribute and therefore my code example fails. This was identified as a bug in Prototype in their issue tracking system and was fixed in 1.6.1.

这篇关于jQuery直播不在IE8中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆