Event parameter not defined for Knockout binding using Firefox

I get this error JS: ReferenceError: the event is not defined when I try to pass an event object to bind the binding when using Firefox 23. Everything works fine in Chrome

Here is the code:

<!-- ko foreach: entries --> <tr data-bind="click: function(){ $parent.expandRow($data, event) }"> ... </tr> <!-- /ko --> vm.entries.expandRow = function(entry, event){ ... } 
+8
javascript firefox events click
source share
1 answer

Here's a solution from github.com/knockout/knockout/issues/752

 <!-- ko foreach: entries --> <tr data-bind="click: function(data, event){ $parent.expandRow($data, event) }"> ... </tr> <!-- /ko --> 

In Firefox, an event is not defined in the window object; instead, it must be passed to a function.

+14
source share

All Articles