8 ms·
How to pass data from PHP to JavaScript
- gondo 12y agowhat is this doing on the HN front page?
- leeoniya 12y agoi'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.