Event parameter not defined for Knockout click binding using Firefox

前端 未结 2 1722
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-14 16:36

I am getting this JS error: ReferenceError: event is not defined when I try to pass the event object to click binding when I use Firefox 23. Ev

2条回答
  •  走了就别回头了
    2021-02-14 17:36

    I know that this is a pretty old question, but still if someone is looking for the answer then I achieved it in the following way:

    Following code (clicked function) is written in the ViewModel for the page:

    this.clicked= function (event) {
        console.log(event.currentTarget.id);
    }
    

    Knockout 3.4.2

    jQuery 3.2.1

提交回复
热议问题