码迷,mamicode.com
首页 > 其他好文 > 详细

脚本模块化能用代码

时间:2021-01-14 11:31:13      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:col   nbsp   rgba   str   not work   root   work   reg   ===   

(function (root, factory) {
    if (typeof define === ‘function‘ && define.amd) {
        // AMD. Register as an anonymous module.
        define([], factory);
    } else if (typeof exports === ‘object‘) {
        // Node. Does not work with strict CommonJS, but
        // only CommonJS-like environments that support module.exports,
        // like Node.
        module.exports = factory();
    } else {
        // Browser globals (root is window)
        root.download = factory();
  }
})(this, function () {
    return function xxx(foo, bar, barz) {
    }
});

 

脚本模块化能用代码

标签:col   nbsp   rgba   str   not work   root   work   reg   ===   

原文地址:https://www.cnblogs.com/johnjackson/p/14275442.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!