一、jQuery创建对象
A = window.A = function (name) {
return new A.prototype.init(name);
}
A.prototype = {
init: function (name) {
this.name = name;
},
sayName: function() {
console.log(this.name);
}
}
//令A原型对象上的init方法的原型对象为A的原型对象(有点像儿子当老子)
A.prototype.init.prototype = A.prototype;
window.$ = A;
var a = $('abby');