jQuery点击事件不工作IE7和IE8 [英] jQuery click event not working IE7 and IE8

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

问题描述

以下代码在IE7或IE8不工作。这是一个错误?它在IE6中很好用(难以置信!)

The following code in IE7 or IE8 doesn't work. Is this a bug? It works fine in IE6 (Incredible!)

http:// jsfiddle.net/zgSmT/

推荐答案

尝试使用 live c> $ 加载

Try using the live event, or binding the event after document load:

$('#clickme').live('click', function(){
    alert('hey');
});

此外,您仍然要加载 scripts.js ,它不存在,在你的小提琴的例子 - 这也可能会导致一个问题。

Also, you're still loading scripts.js, which doesn't exist, in your fiddle example - that might also cause a problem.

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

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