jQuery click events firing multiple times

后端 未结 25 2840
不知归路
不知归路 2020-11-22 11:01

I\'m attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I\'ve run into a problem where the jQuery click event handlers are f

25条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-22 11:41

    When I deal with this issue, I always use:

    $(".bet").unbind("click").bind("click", function (e) {
      // code goes here
    }
    

    This way I unbind and rebind in the same stroke.

提交回复
热议问题