Im wanting to do a tutorial for my blog/portfolio site and I realized that... For all I know about this particular method of jQuery/Javascript programming, I do not know what to call it or what other people call it. I know its a particular method of OOP and the person who showed me how to do this referred to it as "Prototyping". But when searching for it on google, im not finding anything similar. Here is condensed example:
jQuery().ready(function() {
site.internal.page = function () {
return {
init: function () {
var that = this;
},
business: function () {
return {
init: function () {
},
doSomething: function () {
},
addSomething: function (r) {
},
makeSomethign: function () {
}
}
}(),
invoice: function () {
return {
init: function () {
that = this;
},
addItem: function (row) {
}
}
}()
}
}();
site.internal.page.init();
});
Can anyone assist me in figuring out what to refer to this as. Im not sure if its the same as making a library or a plug-in, but id really like to figure it out. Thanks. There are many things going on there, which one are you referring to?
以上就是Not sure about this style of jQuery/Javascript proramming.的详细内容,更多请关注web前端其它相关文章!