标签:
定义的写法
//构造函数 function test(){ //construct code } //初始化方法 test.prototype.init = function(){ //init code }; //扩展方法 test.prototype.expandFunc = function(){ //expend function code };
调用的写法
//定义一个对象实例 var t = new test(); //初始化 t.init(); //调用扩展方法 t.expandFunc();
标签:
原文地址:http://www.cnblogs.com/zcynine/p/5059050.html