-2

what kind of code is that? what does the semikolon mean at the begining of this function?

;(function ( $, window, document, undefined )

what is the purpose to write function like that?

creatorHashChanged: function(event) {}

what does "extend" mean here ?

$.extend( {}, defaults, options );

The complete code:

;(function ( $, window, document, undefined ) {

   function Plugin( options ) {
    this.options = $.extend( {}, defaults, options );

    this._defaults = defaults;
    this._name = pluginName;
    this._tour = defaults.tour;

    if(this.options.delete) this.tourdate_delete(true);
    else this.init();
  }


  Plugin.prototype = {

    init: function() {

    },

    creatorHashChanged: function(event) {

    },

    exitCreator: function() {

    },


})( jQuery, window, document );
Aex Sun
  • 337
  • 5
  • 13

1 Answers1

1

It is do the same function semicolon at the end. I think it writed this way to prevent errors when script will be minimized.

what is the purpose to write function like that?

To catch events

what does "extend" mean here ?

Merge to object in one. Take a look at jquery docs.

Zav
  • 671
  • 3
  • 8