I am very new to jquery.When I go through the sample jquery plugins, I noticed variety of function declaration syntax.Those are follows:
(function($){
function function_name1()
{
//function body
}
var _function_name2 = function(options){
//function body
};
$.fn.function_name3 = {
function_name4:function(){ //function body },
//function body
};
$.fn.function_name5 = function(){
//function body
}
}(jQuery));
I am only aware of the function_name5 syntax.So please help me to find out the difference between the others too.Thanks in advance.
_function_name3is a misnomer as it's an object which holds a property calledfunction_name4that contains a function. For more detail, this link may help