码迷,mamicode.com
首页 > Web开发 > 详细

jQuery面向对象的写法

时间:2015-12-19 14:54:13      阅读:388      评论:0      收藏:0      [点我收藏+]

标签:

 

 定义的写法

//构造函数
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();

 

jQuery面向对象的写法

标签:

原文地址:http://www.cnblogs.com/zcynine/p/5059050.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!