API to save/set/restore the global/document scope.
See the dojo/_base/window reference documentation for more information.
Alias for the current document. 'doc' can be modified for temporary context shifting. See also withDoc().
Alias for the current window. 'global' can be modified for temporary context shifting. See also withGlobal().
Return the body element of the specified document or of dojo/_base/window::doc.
Parameter | Type | Description |
---|---|---|
doc | Document |
Optional
|
win.body().appendChild(dojo.doc.createElement('div'));
changes the behavior of many core Dojo functions that deal with
namespace and DOM lookup, changing them to work in a new global
context (e.g., an iframe). The varibles dojo.global and dojo.doc
are modified as a result of calling this function and the result of
dojo.body()
likewise differs.
Parameter | Type | Description |
---|---|---|
globalObject | Object | |
globalDocument | DocumentElement |
Invoke callback with documentObject as dojo/_base/window::doc.
Invoke callback with documentObject as dojo/_base/window::doc. If provided, callback will be executed in the context of object thisObject When callback() returns or throws an error, the dojo/_base/window::doc will be restored to its previous state.
Parameter | Type | Description |
---|---|---|
documentObject | DocumentElement | |
callback | Function | |
thisObject | Object |
Optional
|
cbArguments | Array |
Optional
|
Invoke callback with globalObject as dojo.global and globalObject.document as dojo.doc.
Invoke callback with globalObject as dojo.global and globalObject.document as dojo.doc. If provided, globalObject will be executed in the context of object thisObject When callback() returns or throws an error, the dojo.global and dojo.doc will be restored to its previous state.
Parameter | Type | Description |
---|---|---|
globalObject | Object | |
callback | Function | |
thisObject | Object |
Optional
|
cbArguments | Array |
Optional
|