In jQuery, I have seen both the following ways of defining a jQuery function:
$.fn.CustomAlert = function() { alert(\'boo!\'); }; $.CustomAlert = function
A
$.a = function() { return "hello world"; }; alert($.a());
B
$.fn.b = function() { return "hello " + $(this).length + " elements"; } alert($("p").b());