JavaScript onClick does not work in Firefox

前端 未结 2 1802
日久生厌
日久生厌 2021-01-23 19:15

I have a confirmation popup that opens when a user clicks on this link:

foo

here is the r

2条回答
  •  既然无缘
    2021-01-23 19:48

    In Firefox, however, the trigger does not seem to work. Any ideas why?

    Firefox does not make the event object global. You have to pass it along to the event handler, e.g.

    onClick="openPopup('#popup1', event)"
    

    Since you are using jQuery, you should bind the handler with jQuery so that you can also use jQuery's augmented event object.

提交回复
热议问题