je vais avoir ce simple code plugin:jQuery: étendre question plug-in
(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);
fonctionne bien - alerte (web.var1) me donne "toto".
ma question: serait-il possible d'étendre ce plugin en incluant simplement un autre .js qui a plus de code? par exemple. que je pourrais demander web.var2
J'ai précédemment utilisé une fonction prototype et je pouvais "l'étendre" en ajoutant simplement un autre js-inclusion qui s'y référait par exemple. comme tWeb.prototype.newfunction = function()
comment cela pourrait-il être fait avec jQuery?
thx