CS3 JS: global
From CS3 JavaScript
global
The global methods and properties.QuickLinks
alert, confirm, decodeURI, decodeURIComponent, encodeURI, encodeURIComponent, escape, eval, isFinite, isNaN, isXMLName, localize, localize, parseFloat, parseInt, prompt, setDefaultXMLNamespace, unescape, unevalProperties
| Property | Type | Access | Description |
|---|---|---|---|
| Infinity | number | r/w | The Infinity global property is a predefined variable with the value for infinity. |
| NaN | number | r/w | The NaN global property is a predefined variable with the value NaN (Not-a-Number), as specified by the IEEE-754 standard. |
| undefined | Undefined | r/w | This global property is a predefined variable with the value for an undefined value. |
Methods
void alert (message:string, title:string [, errorIcon:bool=false])
Displays an alert box
| Parameter | Type | Description |
|---|---|---|
| message | string | The text to display |
| title | string | The title of the alert; ignored on the Macintosh |
| errorIcon | bool | Display an Error icon; ignored on the Macintosh (default: false) |
bool confirm (message:string [, noAsDefault:bool=false], title:string)
Displays an alert box with Yes and No buttons; returns true for Yes
| Parameter | Type | Description |
|---|---|---|
| message | string | The text to display |
| noAsDefault | bool | Set to true to set the No button as the default button (default: false) |
| title | string | The title of the alert; ignored on the Macintosh |
string decodeURI (uri:string)
Decodes a string created with encodeURI().
| Parameter | Type | Description |
|---|---|---|
| uri | string | The text to decode. |
string decodeURIComponent (uri:string)
Decodes a string created with encodeURIComponent().
| Parameter | Type | Description |
|---|---|---|
| uri | string | The text to decode. |
string encodeURI (text:string)
Encodes a string after RFC2396.
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to encode. |
string encodeURIComponent (text:string)
Encodes a string after RFC2396.
| Parameter | Type | Description |
|---|---|---|
| text | string | The text to encode. |
string escape (aString:string)
Creates a URL-encoded string from aString.
| Parameter | Type | Description |
|---|---|---|
| aString | string | The string to be encoded. |
any eval (stringExpression:string)
Evaluates its argument as a JavaScript script, and returns the result of evaluation.
| Parameter | Type | Description |
|---|---|---|
| stringExpression | string | The string to evaluate. |
bool isFinite (expression:number)
Evaluates an expression and reports whether the result is a finite number.
| Parameter | Type | Description |
|---|---|---|
| expression | number | Any valid JavaScript expression. |
bool isNaN (expression:number)
Evaluates an expression and reports whether the result is "Not-a-Number" (NaN).
| Parameter | Type | Description |
|---|---|---|
| expression | number | Any valid JavaScript expression. |
bool isXMLName (name:string)
Returns true is the supplied string is a valid XML name.
| Parameter | Type | Description |
|---|---|---|
| name | string | The XML name to test. |
string localize (what:string, argument:any)
Localizes a ZString-encoded string and merges additional arguments into the string.
| Parameter | Type | Description |
|---|---|---|
| what | string | The string to localize. A ZString-encoded string that can contain placeholder for additional arguments in the form %1 to %n. |
| argument | any | Optional argument(s) to be merged into the string. |
string localize (what:string, argument:any)
Localizes a ZString-encoded string and merges additional arguments into the string.
| Parameter | Type | Description |
|---|---|---|
| what | string | The string to localize. A ZString-encoded string that can contain placeholder for additional arguments in the form %1 to %n. |
| argument | any | Optional argument(s) to be merged into the string. |
number parseFloat (text:string)
Extracts a floating-point number from a string.
| Parameter | Type | Description |
|---|---|---|
| text | string | The string from which to extract a floating point number. |
number parseInt (text:string, base:number)
Extracts an integer from a string.
| Parameter | Type | Description |
|---|---|---|
| text | string | The string from which to extract an integer. |
| base | number | The base of the string to parse (from base 2 to base 36). |
string prompt (prompt:string, default:string, title:string)
Displays a dialog allowing the user to enter text
| Parameter | Type | Description |
|---|---|---|
| prompt | string | The text to display |
| default | string | The default text to preset the edit field with |
| title | string | The title of the dialog; |
void setDefaultXMLNamespace (namespace:Namespace)
Defines the default XML namespace.
| Parameter | Type | Description |
|---|---|---|
| namespace | Namespace | The namespace to use. |
string unescape (stringExpression:string)
Translates URL-encoded string into a regular string, and returns that string.
| Parameter | Type | Description |
|---|---|---|
| stringExpression | string | The URL-encoded string to convert. |
string uneval (what:any)
Creates a source code representation of the supplied argument, and returns it as a string.
| Parameter | Type | Description |
|---|---|---|
| what | any | The object to uneval. |