I have 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);
nice works - alert (web.var1) gives me "foo".
my question is: is it possible to extend this plugin by simply including another .js that has more code? eg. what can i ask for web.var2
i previously used the prototype function and could โextendโ it by simply adding another js-include that referred to it, for example. like tWeb.prototype.newfunction = function()
how can this be done using jQuery?
THX
jquery plugins extend
Fuxi Dec 11 '09 at 1:52 2009-12-11 01:52
source share