jquery class inheritance

后端 未结 6 2051
清歌不尽
清歌不尽 2020-12-24 02:41
var A=function(){
};

$.extend(A.prototype, {
    init:function(){
        alert(\'A init\');
    }
});
var B=function(){

};

$.extend(B.prototype,A.prototype,{
            


        
6条回答
  •  心在旅途
    2020-12-24 02:56

    For OO, it's best to look outside jQuery. jQuery is based on collections returned by selectors.

    If you want classes, some choices are Base2, Joose, and JS.Class.

提交回复
热议问题