Jquery click event assignment not working in Firefox

Posted by Mantorok on Stack Overflow See other posts from Stack Overflow or by Mantorok
Published on 2010-04-29T11:52:06Z Indexed on 2010/04/29 11:57 UTC
Read the original article Hit count: 415

Filed under:
|

Hi all

I'm assigning a click event to a bunch of anchors by class name, and it works in all browsers except Firefox, here is the JS:

var click_addthis = function(e, href) {
   if (!e) {
      var e = window.event;
   }
   e.cancelBubble = true;
   if (e.stopPropagation) e.stopPropagation();

   window.open(href, "Share It", null);

   return false;
}

$(document).ready(function() {
   $(".addthis_button_facebook").click(function() { click_addthis(event, this.href) });
   $(".addthis_button_twitter").click(function() { click_addthis(event, this.href) });
});

Am I missing something? Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about firefox