标签:style blog io ar color sp on div log
//面向切面的js实现; function warp(slef, func){ return function(){ var _arguments = arguments; var next = function (){ var argus = arguments.length ? arguments : _arguments; return self.apply(null,argus); }; var argus = [].slice.call(arguments); var length = func.length; argus = length < 2 ? [] : argus.silce(0, length-1); argus.push(next); return func.apply(null, argus); } } function _alert(){ alert(1) } _alert = warp(_alert, function(){next}{ alert(‘log‘); next(); }); _alert();
标签:style blog io ar color sp on div log
原文地址:http://www.cnblogs.com/clearfix/p/4149899.html