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

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -