jQuery: extend plugin question
- by Fuxi
hi all,
i'm having this simple plugin code:
(function ($) {
$.fn.tWeb = function ()
{
var me = this;
me.var1 = "foo";
this.done = function()
{
return this;
}
return this.done();
};
})(jQuery);
var web = new jQuery.fn.tWeb();
alert(web.var1);
works nice - alert(web.var1) is giving me "foo".
my question: would it be possible extending this plugin by simply including another .js which has more code? eg. that i could ask for web.var2
i previously used a prototype function and could "extend" it by simply adding another js-include which refered to it eg. like tWeb.prototype.newfunction = function()
how could this be done with jQuery?
thx