x6.json.process
The Javascript method x6.json.execute is the final
step in sending and receiving JSON requests. This
routine does the following:
This example shows how you can retrieve table data and
then process it:
<script>
x6.json.init('x4Page','myCustomPage');
x6.json.addParm('x4Action','getStates');
// x6.json.execute will return false on errors
if(x6.json.execute()) {
// x6.json.process puts everything in its place...
x6.json.process();
// ...so that we can handle the returned data
for (var idx in x6.data.states) {
// do something
}
}
<script>
This code requires the following PHP code on the server:
<?php
# this is file application/x4myCustomPage.php
class x4myCustomPage extends androX4 {
function getStates() {
$states = SQL("Select * from states");
x4Data('states',$states);
}
}