From the Docs:
(function( $ ){
$.fn.myfunction = function() {
alert('hello world');
return this;
};
})( jQuery );
Then you do
$('#my_div').myfunction();
More Related Contents:
- jQuery 1.9 .live() is not a function
- How can I create an Asynchronous function in Javascript?
- jQuery’s .click – pass parameters to user function
- How to add an object to an array
- jQuery pass more parameters into callback
- In Javascript/jQuery what does (e) mean?
- Make function wait until element exists
- functions inside or outside jquery document ready
- jQuery call function from a string [duplicate]
- What event does JQuery $function() fire on?
- What is the purpose of this? (function ($) { //function code here })(jQuery);
- Passing parameters to a JQuery function
- jQuery asynchronous function call, no AJAX request
- Function not calling within an onclick event
- difference between parseInt() and parseFloat() [duplicate]
- Regular Expression jquery validation1 [duplicate]
- I would like to ask how to explain this (javascript function)
- Can’t append element
- Convert array to JSON
- CORS – How do ‘preflight’ an httprequest?
- How to change value of object which is inside an array using JavaScript or jQuery?
- Getting Error “Form submission canceled because the form is not connected”
- Parsing CSS in JavaScript / jQuery
- CSS media queries and jQuery window .width() do not match
- Responsive horizontal page sliding
- Embed HTML5 YouTube video without iframe?
- how to resolve iframe cross domain issue [duplicate]
- Storing a variable in the JavaScript ‘window’ object is a proper way to use that object?
- Uncaught ReferenceError: $ is not defined error in jQuery
- JQuery issue “TypeError: $.getJSON is not a function”