[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Geuintoo
Great, thank you!!

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Geuintoo
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!

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Jordon Bedwell
: 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

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Geuintoo
Perfect, thanks!

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread Jordon Bedwell
-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

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread RobG
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(){ ... }

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-08 Thread RobG
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

[jQuery] Re: Learning about functions and methods (I am confused)

2009-04-07 Thread Eric Garside
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,