dojo.global

Deprecated.

Dojo.global was originally created to either:

Regarding the first usage, modern AMD modules probably should not be trying to set or read global variables at all. If they do, a syntax like:

require([...], function(...){
     var global = this;
     ...
     global.myVariable = "hello world";
});

is preferable to using dojo/_base/kernel::global. For strict modules, a slightly more complicated syntax is required:

"use strict";
require([...], function(...){
     var global = Function("return this")();
     ...
     global.myVariable = "hello world";
});

As for accessing the window object (to control scrolling, setup handlers, etc.), most application code can simply access the window global, rather than accessing dojo/_base/kernel::global.

Table of Contents

Error in the documentation? Can’t find what you are looking for? Let us know!