Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Migrated to Confluence 5.3
Excerpt |
---|
Indicates a global was added by a script using the Define API. |
Notes
A define with state Define.ADDED was originally missing, but has since been added using Define().
Added defines are immutable.
Note: If the define wasn't originally missing, the new define would have a state of of Define.REPLACED.
Examples
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
// always use strict equality checks if (Define.stateOf("chat") === Define.ADDED) { // native chat function was missing, but was added by script } | ||||||||
Code Block | ||||||||
| ||||||||
// when using switch, order of cases is vitally important switch (Define("chat")) { case Define.MISSING : return "chat() is missing"; case Define.REMOVED : return "chat() was removed by script"; case Define.ADDED : return "chat() was added by script"; case Define.REPLACED: return "chat() was overridden by script"; case Define.NATIVE : return "chat() function is native"; default: return "Status of chat() is unknown"; } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Define APITopics:
|