js风格技巧
时间:2014-02-10 16:51:02
收藏:0
阅读:385
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文件。
原文:http://www.cnblogs.com/kinger906/p/3542808.html
评论(0)