无标题文章

2015-03-23  本文已影响0人  Hank_Han

functiontest(){

console.log("Hello world!");

}

(function(){

varbox=function(){

returnbox.fn.init();

};

box.prototype=box.fn={

init:function(){

console.log('box.init()');

returnthis;

},

add:function(str){

alert("add",str);

returnthis;

},

remove:function(str){

alert("remove",str);

returnthis;

}

};

box.fn.init.prototype=box.fn;

window.box=box;

})();

vartestBox=box();

testBox.add("jQuery").remove("jQuery");

上一篇 下一篇

猜你喜欢

热点阅读