User Tools

Site Tools


uphp:ajax_generation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
uphp:ajax_generation [2019/07/22 06:41]
admin created
uphp:ajax_generation [2021/09/13 05:57] (current)
Line 10: Line 10:
 "string_key":"my string", "string_key":"my string",
 "array_key":[1,5,6], "array_key":[1,5,6],
-"object_key":{"name":"Joe","age:21"},+"object_key":{"name":"Joe","age":21},
 "array_object_key":[ "array_object_key":[
-  {"name":"Joe","age:21"}, +  {"name":"Joe","age":21}, 
-  {"name":"Jane","age:32"}+  {"name":"Jane","age":32}
 ], ],
 </code> </code>
  
 End each parameter with a comma (,). End each parameter with a comma (,).
 +
 +==== Generating AJAX in Blockly ====
 +Below is an example script that will increment a global variable 'cnt' and send it to the AJAX output.
 +{{:uphp:home_ajax.png|}}
 +
 +Example output of this:
 +<code json>
 +"cnt":334, 
 +</code>
 +
 +Note that the hook 'In Ajax Generation' needs to be selected for this.
 +
 +To see how to use this variable on the home page, see [[Blockly Home Page Hook]]
 +
uphp/ajax_generation.1563777703.txt.gz · Last modified: 2021/09/13 05:56 (external edit)