Ruby's Louvre

每天学习一点点算法

导航

2013年3月26日 #

近似方法的实现

摘要: mass Framework使用了许多手段来一起生成近似方法,从而大大减少代码量,提高维护性。比如append, prepend, before, after这几个方法,在jQuery2.0,它们是这个样子:append: function() { return this.domManip(arguments, true, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.appendChild( elem ); } }); }... 阅读全文

posted @ 2013-03-26 09:23 司徒正美 阅读(1563) 评论(2) 推荐(0)