Using AJAX with JSON
A simple demonstration of how AJAX works as shown below in these two examples:
- Example 1:
- When you hover the mouse over any picture in the table below, you should see a title (text will appear). The titles are from a JSON file named "imgInfo.json" in the server. this JSON file contain the id and title fields. After the JSON data are being parsed, each title will value will be attached to its corresponding image using the id values.
- Example 2:
- Beneath the pictures table there is a sentence, when you click "Show/Hide (Toggle) All info" link, an xml file will be fetched from the server and appears as table..