Feature Rich
Rapid Application Development
Helping you or your customers
Manage their Business

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"}
{"name":"John","age":30,"city":"London"}
Example 2 Example
["Clive","Alan","Chris"]
to add a Comment.