What are some best practices for transporting data from PHP to Javascript?
<p>My projects are becoming more and more JS heavy. The issue is that most of my data is on the server side (PHP). What are some clean ways for transporting this data over to the client side (code samples for extra brownie points)? </p>

<p>Some ways I am considering - which of these are best?:</p>

<p>1) Use php to "echo" directly to js variables.
 2) Use php to write to HTML elements and then use js to retrieve from the dom.
 3) Use ajaxcall</p>

<p>Thoughts?</p>
