While the jquery "extension" function is the correct way to expand the library, it has two forms.
$. fn.extend, which is what you use in your example, is used to add extra functions to real DOM objects. For example, your "myFunction" function can be used this way if you want to perform an action on the "document" object in dom. $ (Document) .myFunction ()
To expand the jQuery static namespace, you need to use the $ .extend function instead (note the lack of fn)
(function($){ $.extend({
should be what you are looking for.
source share