if (!Function.prototype.bind) { Function.prototype.bind = function bind(thisValue){ var func = this; return function() { return func.apply(thisValue, arguments); } } }