jQuery Plugin Actions vs Utilities

Brian Layman said on January 24, 2008

Excellent Jonathan! Thanks for this post!

Damjan Mozeti?? said on January 24, 2008

I never thought this could be so simple and I'd probably never take the time to look into it myself :) Thanks for the tip!

Liu Leren said on January 25, 2008

I am getting better and better with jquery (and that is not just because of me :) thanx!

Thame said on January 26, 2008

For times when you need something in between a basic method and a full-fledged plugin, it can be handy to extend jQuery directly.

For example:


jQuery.fn.extend({
	sample : function() {
		// do something and keep chaining
		return this;
	},
});
Christopher Hill said on January 27, 2008

Nice article. Generally speaking, there always seems to be a plugin of what I want to do, so I haven't had the need to jump into developing a plugin.

Ariel Flesler said on January 29, 2008

Good article, Mike Alsup made an excellent article on jquery plugins some time ago. http://www.learningjquery.com/2007/10/a-plugin-development-pattern

About "Approach 1"... I usually use the static name for a function that internally calls the method with some specific values. Sometimes the other way around too. That's the case of ScrollTo, LocalScroll and Preload.

Blake said on October 01, 2008

Very good and clear article. Thank you!

Luis said on December 30, 2008

great article, thx! I'm going to give it a try!

sepide said on February 05, 2011

hi
thank you for your article,
please help me,i have added class to website and have written some public static method in class.
now i want to call them with jquery,without webservice,
is there any solution for this work?

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.
f2富二代官网入口