What is “.el” in relationship to JavaScript/HTML/jQuery?

后端 未结 4 1891
梦如初夏
梦如初夏 2021-02-19 04:13

I couldn\'t find much from Googling, but I\'m probably Googling the wrong terms.

I\'m trying to understand what the \"el\" in \"$.el\" is from here: http://joestelmach.g

4条回答
  •  名媛妹妹
    2021-02-19 05:03

    You can obtain the explanation seeing the source of the project in the github:

    // If we're in a CommonJS environment, we export our laconic methods
      if(typeof module !== 'undefined' && module.exports) {
        module.exports = laconic;
      } 
    
      // otherwise, we attach them to the top level $.el namespace
      else {
        var dollar = context.$ || {};
        dollar.el = laconic;
        context.$ = dollar;
      }
    

    The code means that $.el namespace will have the function laconic() and this function create elements using document.createElement and append to the body.

提交回复
热议问题