日期:2014-05-16 浏览次数:20427 次
Function.prototype.binding = function() { if (arguments.length < 2 && typeof arguments[0] == "undefined") return this; var __method = this, args = jQuery.makeArray(arguments), object = args.shift(); return function() { return __method.apply(object, args.concat(jQuery.makeArray(arguments))); } } function a(obj) { $("#id").bind("click", function(obj) { alert(obj); }.binding(this, obj)); }