button onclick function firing twice

后端 未结 7 1596
天涯浪人
天涯浪人 2020-12-08 00:20

I have a button that calls a javascript function using an event handler. For some reason, the event handler is being called twice.

Here is my button (I am using a ph

7条回答
  •  孤街浪徒
    2020-12-08 01:04

    I know this is an old post, but for this type of error:

    • It may be that you have duplicate events bound
    • Either the event handler could be hooked up twice, or maybe the event isn't being unbound, after the intended listener(s) have finished listening and have done their job.

    In this case, you need to do something to unbind the listener once you no longer need to listen.

提交回复
热议问题