$.fn is the jQuery prototype. You would create such a function when you want to extend jQuery and call the function as a method of the wrapped set. Within the function, the function context (this) refers to the wrapped set.

If that's not what you want to do, simply create a standalone function.

Bear Bibeault wrote:$.fn is the jQuery prototype. You would create such a function when you want to extend jQuery and call the function as a method of the wrapped set. Within the function, the function context (this) refers to the wrapped set.

If that's not what you want to do, simply create a standalone function.

Great perfect, what I was thinking. So like a showAlert which isn't a function to act on a wrapped set, it should be function showAlert().