jQuery点击< object>的侦听器在IE失败 [英] jQuery click listener on <object> in IE failing

查看:157
本文介绍了jQuery点击< object>的侦听器在IE失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击(function(){
//获取点击链接的ID:
var link = $(this).closest(h2)。attr(title);
var id = $(this).closest(div)。attr(id);
showDialog (link,id);

return false;
});

这会触发一个模式(jQuery UI)。它在FF,Chrome / Safari中工作,但不在IE 7/8中。有没有什么我在这里失踪?

大图:我们使用swf来呈现自定义类型,并且呈现(flash)内容中有一个链接。我们希望能够捕获jQuery监听器中的链接操作,所以我们不必在链接点击时扩展swf的可选参数<返回false



我们认为我们已经解决了,直到IE测试开始...

让我知道是否需要更多信息。谢谢!

解决方案

奇怪的是,在其他浏览器中工作。不是说在IE中不起作用。看看这个问题。 Flash对象将始终使用onclick事件,并且不会将其传播到JavaScript代码中。


$("#listView object.modal").click(function(){
        // Get the ID of the clicked link:
        var link = $(this).closest("h2").attr("title");
        var id = $(this).closest("div").attr("id");
        showDialog(link, id);

        return false;
    });

This fires a modal (jQuery UI). It it working in FF, Chrome/Safari but not in IE 7/8. Is there something I'm missing here?

Big Picture: We're using a swf to render custom type and there is a link in the rendered (flash) content. We're hoping to catch the link action in the jQuery listener so we don't have to extend our swf have an optional param to return false on link click.

We thought we got around it, until IE testing commenced...

Let me know if any more info is needed. Thanks!

解决方案

The strange thing is that is working in other browsers. Not that it doesn't work in IE. Have a look at this question. Flash objects will always consume the onclick event and not propagate it in javascript code.

这篇关于jQuery点击&lt; object&gt;的侦听器在IE失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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