Processing JSON data

JavaScript Object Notation (JSON) provides web developers with a clean and efficient way to encode data. JSON is a widely adopted format. It simplifies data processing and manipulation. To read more about why you should use JSON, visit http://www.revillweb.com/why-use-json/.

Getting ready

Ensure that your web server is running and you have access to the web root where you can save/upload the files that you will create as part of this recipe.

How to do it…

Learn how to use JSON-formatted data with JavaScript by performing the following steps:

  1. Create a PHP file named request-3.php and save it to the web root of your web server. Use the following PHP code to create and output a list of names as JSON data:
    <?php //Create an array of ...

Get jQuery 2.0 Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.