05 - jQuery静态方法,实例方法
静态方法
直接添加给类
AClass.staticMethod = function () { alert("staticMethod"); }
静态方法通过类名调用
AClass.staticMethod();
实例方法
给类添加一个实例方法
AClass.prototype.instanceMethod = function () { alert("instanceMethod"); }
实例方法通过类的实例调用,创建一个对象
var a = new AClass(); a.instanceMethod();
原文作者: 冯亚杰(DanBoard·Feng)
原文链接: http://danbo3110.github.io/2019/10/23/05 - jQuery静态方法,实例方法/
版权声明: 转载请注明出处(必须保留作者署名及链接)