PHP Developer / Blog

Posts Tagged ‘json’

Have prototype.js automatically eval JSON responses

Wednesday, February 20th, 2008

JSON is the perfect format for passing data from a server to JavaScript. With the prototype.js the JSON string sent by the server is automatically evaluated to a native JavaScript datatype. In order to do this you need to pass the data back with a content-type of application/json.

Step 1
First we’ll need to set up a script (PHP in this case) on the server to return a JSON string and specify the content type. This is easily done using the following code: (more…)


About this site:
This is my (Jaisen Mathai) personal site for potential employers who want to see my resume or portfolio. My ideal job would be to work as a PHP developer on a large scale consumer website. My experience is in using PHP, MySQL, Ajax and JSON. I really enjoy creative brainstorming...taking a problem apart and narrowing 100 solutions down to the best one.

Thanks for stopping by. Be sure to drop me a line.