Reputation: 12517
I have a php file that echos JSON encoded arrays, the contents of which are pulled from a remote database.
I want to be able to pass this data from the PHP file to a Javascript file linked to a running HTML file displayed in the browser.
What are the best practises for passing data, particularly in JSON format fromPHP to Javascript...
Upvotes: 0
Views: 266
Reputation: 191809
The jQuery Javascript library provides a bunch of great ways for handling Ajax. JSON is a wonderful format for client/server communication, even as-is. XML is also good.
If you are talking about long polling, you may also want to look into COMET
Upvotes: 1