Use json_encode to write JS variables.
Merge branch 'json' into scaling_example
sample scaling page