我正在使用underscore.js中的_.bind方法,但是在IE8/9中它无法正常工作。
我知道MDN有一个解决方法(MDN Polyfill),但不确定是否可以应用于underscore库,或者是否在underscore本身中有修复此问题的方法。
我想要实现的一个例子是:
window.onload = _.bind(function() {
this.product.quantityListing();
}, this);
编辑:我在其他地方使用了_.bind实例,它在IE8中能够正常工作——然而,在我想要检查窗口是否已经加载完成时,它就无法工作了。
new _.bind(fn)
?这里的new
似乎是无用的。 - Ja͢ck