在点击处理程序中正确使用绑定和引用对象值

这个问题在这里已经有了答案:

  • Javascript调用()&apply()vs bind()? 17个答案

  • bind()使你绑定的元素成为方法内的'this'。 您应该使用'this'作为参考,而不是您在绑定时使用的名称。

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind

    链接地址: http://www.djcxy.com/p/96991.html

    上一篇: Proper use of bind and referencing objects values in a click handler

    下一篇: Preference between call and bind in javascript?