开发者

jquery event handler calls the function twice

When the a-tag with the class "like" is clicked the event handler calls the function twice. I tried all hints of an event bubbling post, but they didn't work or were not me case.开发者_开发技巧

$('.like').live('click', function(){
    $.get($(this).attr('rel'), function(data)
    {
      $('.like').html(data);
    });
    return false;
 });

Maybe you have some more possible solutions for me?


did you try this?:

$('.like').die().live('click', function(){


Looks like everything works as supposed (take a look at the console):

http://jsfiddle.net/KU82w/1/

Can you provide the piece of HTML that your link is in?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜