(function($, window, undefined) {...})(jQuery, window);

(function($, window, undefined) {...})(jQuery, window);

Hi,

using and having a look at jquery.ascensor.js plugin, I can see that the
code for this plugin is structured like that :

  1. (function($, window, undefined) {
  2.       ...
  3.     $.fn[pluginName] = function(options) {
  4.         return this.each(function() {
  5.             ...
  6.         })
  7.     }
  8. })(jQuery, window);

So far, I only know this notation

  1. (function($)
  2. {
  3.     $.fn.myPlugIn=function(parameters)
  4.     {
                ...
  5.     };
  6. })(jQuery);
Anyone to explain to me the first structure ? Or point to a tutorial ? Thanks