jQuery click event fired twice in firefox but not in IE

落爺英雄遲暮 提交于 2019-12-25 09:13:45

问题


I've got an image like this:

<img class="linkDelete" src="some_path"/>

I use jQuery click event on the image:

$('.linkDelete').click(function(event) {
    event.preventDefault();
    $(location).attr('href', some_location);
});

The event is fired twice in Firefox but once in IE. I'd like to know if there's a solution to make it fire only once in Firefox? Thanks :)

PS: I tried by deleting the href="#" in the img tag. No use...

来源:https://stackoverflow.com/questions/19385939/jquery-click-event-fired-twice-in-firefox-but-not-in-ie

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