jquery - JavaScript onClick does not work in Firefox -
i have confirmation popup opens when user clicks on link:
<a onclick="openpopup('#popup1')">foo</a>
here relevant javascript:
function openpopup(id) { $(id).show(); event.preventdefault(); $(id).addclass('is-visible'); $(id).css("z-index", "999999999999999999999999"); }
in safari , chrome works fine. in firefox, however, trigger not seem work. ideas why?
i tried change link so:
<a href="javascript:openpopup('#popup1');">foo</a>
no changes though. help!
in firefox, however, trigger not seem work. ideas why?
firefox not make event object global. have pass along event handler, e.g.
onclick="openpopup('#popup1', event)"
since using jquery, should bind handler jquery can use jquery's augmented event object.
Comments
Post a Comment