if(!Function.prototype.bind){
Function.prototype.bind = function(){
if(typeof this !== 'function'){
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var _this = this;
var obj = arguments[0];
var ags = Array.prototype.slice.call(arguments,1);
return function(){
_this.apply(obj,ags);
};
};
}
IE8- bind() 函数兼容
最新推荐文章于 2020-12-05 21:10:29 发布