导航栏: 首页 评论列表

让Firefox兼容attachEvent事件

默认分类 2011-01-23 17:46:27

让Firefox兼容attachEvent事件

<

pre> Object.prototype.attachEvent = function(method,func) { if(!this[method]){ this[method]=func; } else{ this[method]=this[method].attach(func); } } Function.prototype.attach=function(func){ var f=this; return function(){ f(); func(); } }

<

pre>


>> 留言评论