js风格技巧

1.一个页面的所有js都可以写成这样,比如:
   var index ={};
   index.User = ****;
   index.Init = function(){ $("$test").bind("click",index.Test); ***** };
   index.GetStartTime = function { return ***;}
   index.GetEndTime = function(){ return ***;}
   index.Test = function(){ ****;}
   好处是:可以干净利落的将所有方法事件属性放在Index对象里,最后我们可以将Index对象提炼成为一个js文件。

原文地址:https://www.cnblogs.com/kinger906/p/3542808.html