

How to pass data from PHP to JavaScript - inglor
http://stackoverflow.com/q/23740548/1348195

======
leeoniya
i'm not sure why this is on the front page as it seems very obvious. but i
occasionally echo json-encoded data directly into the script to aid with quick
rendering/low latency, minimizing # or requests.

things like initial data points for a js chart are a good example of when this
is useful.

------
gondo
what is this doing on the HN front page?

