如果不包装到函数中,我无法代理函数 a:
function a(b) {
if (arguments.length != 0){
throw 'illegal';
}
alert(this);
}
jQuery.proxy(a,"Great!"); /// throw error because b is an event.
jQuery.proxy(a,"Great!",undefined); // throw error because length is 1
jQuery.proxy(function(){a();},"Great!"); // ok, but not directly.
我不能改变功能!
有任何想法吗?