The bind () function was added to the ECMA-262 fifth version; it may not run on all browsers. You can make it work by adding the following code partially at the beginning of the script so that unsupported browsers can also use the bind () function
if(!Function.prototype.bind) {Function.prototype.bind=function(othis) {if(typeof This!== "function") { //closest thing possible to the ECMAScript 5 //Internal iscallable function Throw NewTypeError ("Function.prototype.bind-what is trying to be bound are not callable"); } varAargs = Array.prototype.slice.call (arguments, 1), Ftobind= This,//This here points to the target functionFnop =function() {}, Fbound=function() { returnFtobind.apply ( This instanceofFnop? This //here This is the obj that is generated when you call new obj (): Othis | | This,//bind Fbound to this if Othis is invalid //The arguments passed by BIND are merged with the arguments passed at the call and passed as the final argumentAargs.concat (Array.prototype.slice.call (arguments))); }; //Copy the prototype object of the target function into the new function, because the target function may be used as a constructorFnop.prototype = This. prototype; Fbound.prototype=NewFnop (); returnFbound; };}
JavaScript Object Bind () method compatible processing