推荐关注
› Meteor
› JSLint - a JavaScript code quality tool
› jsFiddle
› D3.js
› WebStorm
推荐书目
› JavaScript 权威指南第 5 版
› Closure: The Definitive Guide
sivacohan

这种代码怎么读?在require.js的文档里面看到的

  •  
  •   sivacohan · Apr 1, 2013 · 4338 views
    This topic created in 4965 days ago, the information mentioned may be changed or developed.
    3 replies  •  1970-01-01 08:00:00 +08:00
    sivacohan
    sivacohan
    OP
    Apr 1, 2013❤️1
    1
    怎么贴gist啊?搞不清楚了
    zythum
    zythum
    Apr 1, 2013❤️1
    2
    这里面的this 是 window。 就是 创建了一个局部变量 $ = window.jQuery. window.myExample 等于一个空方法。 外面那个是闭包自执行。
    Frannk
    Frannk
    Apr 3, 2013
    3
    这样呢?
    (function (globle) {
    var $ = this.jQuery;

    globle.myExample = function () {};
    }(this));
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5200 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:13 · PVG 14:13 · LAX 22:13 · JFK 01:13
    ♥ Do have faith in what you're doing.