TypeError: h.apply is not a function

Exceptions, JavaScript, OracleJET By Nov 22, 2016 No Comments
This is a Knockout JS error. I faced this issue when I am trying to invoke click action of a link created. My link statement is like below.
<a data-bind=”attr:{id:Reqid},text: Title,click: $(‘#popup1’).ojPopup(‘open’, ‘#btnTitle’)”></a>
And on click of this link, I am getting the below error.
TypeError: h.apply is not a function
This is because the click handler needs to be wrapped within a function. Below updated statement resolved the issue.
<a data-bind=”attr:{id:Reqid},text: Title,hover: function(){$(‘#popup1’).ojPopup(‘open’, ‘#btnTitle’)}”></a>

No Comments

Leave a comment

Hi, Welcome here.
And get notified everytime we publish a new blog post.