Using Jquery we will develop code to handle Json data. For this we will use getJSON function and then using each looping we will display data.
We will start with simple Json object with a set of name value pairs. We have three examples here and each button is connected to one click event.
To display the return data we have div element.
The Json data or the Json string is kept inside a .php file and for this example we have kept the string inside json1.php file.
Here is the string in Json format. You can keep in any file you want but output should match Json format.
The use the above demo you can download the zip file. Inside the main file is getJSON-demo.php file. The Json data string are kept inside json1.php, json2.php and json3.php file. Google SDN is used to link Json library so ensure that you are connected to internet while testing the script or you can download and use the Json library.