| Platform | Since |
|---|---|
| Android | 0.8 |
| iPhone | 0.8 |
| iPad | 0.8 |
| Mobile Web | 1.8 |
APIs that live in the global scope.
Titanium provides a number of global built-in objects.
Titanium has a built-in JSON parser with two main functions: parse and stringify. JSON.parse will safely evaluate a string encoded as JavaScript into a JavaScript object. JSON.stringify will encode a JavaScript object into a string.
Titanium has built-in support for one-shot and repeating timers with two main functions: setTimeout and setInterval. setTimeout takes 2 arguments: function and timeout in milliseconds after which the function should be executed and returns a timer handle that can be used to cancel a pending timer with clearTimeout. setInterval takes 2 arguments: function and timeout in milliseconds for how often the function should be executed until cancelled and returns a timer handle that can be used to cancel a timer with clearInterval.
Titanium has a built-in convenience function alert which can be used as a shortcut to create and show a simple AlertDialog.
The macro L can also be used which aliases the method Titanium.Locale.getString.
| Name | Summary |
|---|---|
| L |
An alias for |
| alert |
Displays a pop-up alert dialog with the passed in |
| clearInterval |
Clear an interval timer from being fired. |
| clearTimeout |
Clear a timeout timer from being fired. |
| decodeURIComponent |
Replaces each URI encoded escape sequence in the passed in |
| encodeURIComponent |
Replaces all URI special characters in the passed in |
| require |
Loads either a native Titanium module, or a CommonJS module. |
| setInterval |
Creates an interval timer that calls |
| setTimeout |
Creates a timer that calls |