Built-In Namespace _global_
Field Attributes | Field Name and Description |
---|---|
The
console built-in object, loosely modeled after the
CommonJS console,
except it only provides the log() method. |
Method Attributes | Method Name and Description |
---|---|
clearInterval(id)
Clears the execution delay of a function set by
setInterval . |
|
clearTimeout(id)
Clears the delay set to a function by
setTimeout . |
|
require(name)
Provides access to modules from Content Studio.
|
|
setInterval(fn, delay)
Executes a function repeatedly, with fixed delay between each call of the function.
|
|
setTimeout(fn, delay)
Executes a function after a specified delay.
|
Field Detail
console
The
console
built-in object, loosely modeled after the
CommonJS console,
except it only provides the log()
method.
console.log('the time is', new Date()); // prints "the time is Tue Jul 28 ...."
Method Detail
clearInterval(id)
Clears the execution delay of a function set by
setInterval
.
- Parameters:
- id
- - is the ID of the interval that need to be clear, returned by the
setInterval
.
clearTimeout(id)
Clears the delay set to a function by
setTimeout
.
- Parameters:
- id
- - is the ID of the timeout that need to be clear, returned by the
setTimeout
.
require(name)
Provides access to modules from Content Studio.
The
require()
is inspired from
CommonJS Modules to avoid
polluting the global namespace with additional variable names.
Most, if not all proprietary functionality is hidden behind require() in order to facilitate testing code and to extend the set of modules without breaking existing scripts.
var actions = require("content-studio");
- Parameters:
- {String} name
- The name of the API that needs to be accessed.
setInterval(fn, delay)
Executes a function repeatedly, with fixed delay between each call of the function.
The fn is a function to be executed after
delay
milliseconds.
The function will be executed repeatedly after the specified delay.
- Parameters:
- {Function} fn
- the function to be executed periodically
- {int} delay Optional, Default: 0
- the number of milliseconds (thousandths of a second)
that the function call should be delayed by. Default value for
delay
is 0
- Returns:
- An object representing the task to be executed, which can be used later with
clearInterval
.
setTimeout(fn, delay)
Executes a function after a specified delay.
The fn is a function to be executed after
delay
milliseconds.
The function will be executed only once after the specified delay.
- Parameters:
- {Function} fn
- the function to be executed at some point in the future.
- {int} delay Optional, Default: 0
- the number of milliseconds (thousandths of a second)
that the function call should be delayed by. Default value for
delay
is 0
- Returns:
- An object representing the task to be executed, which can be used later with
clearTimeout
.