jQuery click listener on <object> in IE failing

China☆狼群 提交于 2019-12-02 10:51:24

问题


$("#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!


回答1:


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.



来源:https://stackoverflow.com/questions/2701760/jquery-click-listener-on-object-in-ie-failing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!