代码改变世界

js的绑定函数

2012-11-19 09:28  yangpan  阅读(202)  评论(0)    收藏  举报

Function.prototype.bindFunc = function (b) {
if (typeof (b) != "object") {
return false
}
var a = this;
return function () {
return a.apply(b, arguments)
}
};