Great, thank you!!
But how to extend a sub method?
// Extend sub method
$.extend({
$.myPlugin = {
myExtendedMethod: function(){ alert('Extended submethod
called'); }
}
});
// Won't work:
$.myPlugin.myExtendedMethod();
Thanks for any tipp!
: Wednesday, April 08, 2009 1:39 AM
To: jQuery (English)
Subject: [jQuery] Re: Learning about functions and methods (I am confused)
But how to extend a sub method?
// Extend sub method
$.extend({
$.myPlugin = {
myExtendedMethod: function(){ alert('Extended submethod
called
Perfect, thanks!
-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of RobG
Sent: Wednesday, April 08, 2009 5:36 AM
To: jQuery (English)
Subject: [jQuery] Re: Learning about functions and methods (I am confused)
On Apr 8, 6:49 pm, Jordon Bedwell jor...@envygeeks.com wrote:
Try:
$.extend
On Apr 8, 6:49 pm, Jordon Bedwell jor...@envygeeks.com wrote:
Try:
$.extend({
myPlugin:{
myExtend:function() {
alert('This');
}
}});
Can you say why that is better than:
$.myPlugin.myExtend = function(){ ... }
On Apr 8, 2:03 am, Geuintoo drummerb...@gmail.com wrote:
Hy
(function($){
$.myPlugin = function(){
holla: function(){
alert('holla');
}
}
The above will create a myPluggin property of the object referenced by
$ (which is the
Yes. You can add methods to any function, but ideally, if you're
calling sub functions, you should use $.myPlugin as an object, rather
than a function.
(function($){
$.myPlugin = {
myMethod: function(){ alert('called'); }
}
})(jQuery);
$.myPlugin.myMethod();
On Apr 7, 12:03 pm,
8 matches
Mail list logo