semikolon在这个函数开始时是什么意思

what does the semikolon mean at the begining of this function?

本文关键字:开始时 是什么 意思 函数 semikolon      更新时间:2023-09-26

那是什么样的代码?在这个函数开始的时候,semikolon是什么意思?

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

这样写函数的目的是什么?

creatorHashChanged: function(event) {}

"延伸"在这里是什么意思?

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

完整代码:

;(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 );

它在末尾执行相同的函数分号。我认为这样写是为了防止脚本最小化时出现错误。

这样写函数的目的是什么?

捕捉事件

"延伸"在这里是什么意思?

合并到一个对象中。看看jquery文档。

相关文章: