In my previous article I discussed some of the basics of JSON, the JavaScript Object Notation. It is an object literal notation well suited for data exchange. The object and arrays of JSON are very similar to real world data representation in many programming languages and this makes it a natural competitor with the more ubiquitous XML.
AJAX with JSON - Retrieving JSON Text using AJAX (Page 2 of 4 )
The JSON Text on the web server
In the previous article an equivalent JSON object which has the same structure as the webstudents.xml file was developed using the basic features of the JSON. In particular the following object representing the XML file except for the comment node can also be added if necessary.
The JSONWebStudents.txt file is the textual representation of this serialized object. The JSONWebStudents.txt file is shown in the next listing. This is the file that will be retrieved when the AJAX call is made. Just insert the listing shown in Notepad and save it to the root directory of your server. Notice there is no semi-colon at the end.