I'm sure this has been asked a million times, but what is the accepted approach to this?
I have been writing php code for a while and up until recently I only copied+pasted javascript code, but now with help from YUI I've begun to understand javascript and want to use it more in an existing web app I have. I want to get various amounts of data from databases etc to the clientside javascript. I have access to this data in my php pages when loading.
What is the correct way to get this data to my client side script.
If you can send the data with the page, I'd do that, (That is, number one) but retrieving with Ajax is probably the best-choice when the page has already been loaded.