All Commands
All Variables
Commands
ARRAY_JSON
This will return an arrays content as an encoded JSON string ready to be returned via AJAX to a JavaScript function.
e.g.
If you setup a page with the following content:
{VAR(V_RESP())}
{SET(V_RESP(name), John)}
{SET(V_RESP(age), 30)}
{SET(V_RESP(city), London)}
{RETURN({ARRAY_JSON(V_RESP)})}
This can then be accessed via a JavaScript AJAX call using the following code:
udb.ajax.page_json(page_id, "mydata=123", function(d){
var obj = JSON.parse(d.content);
console.log(obj.name, obj.age, obj.city);
});
Number | Name | Default | Type | Description |
---|---|---|---|---|
1 | name | String | The name of the Array to encode |
Example 1 Example
{"name":"John","age":30,"city":"London"}
Example 2 Example
ARRAY Commands
ARRAY_CLEARARRAY_FOR_EACH
ARRAY_JOIN
ARRAY_QTY_IN
ARRAY_SIZE
OPT_LIST_ADD
SEQN
VARIABLE Commands
ADDARRAY_CLEAR
ARRAY_JOIN
ARRAY_QTY_IN
ARRAY_SIZE
EMPTY
GET
GET_XML
IS_SET
ORDINAL
SET
SET_XML
VAR
VARS