- Fetching Data by Using SQL
The script below fetches dynamic data from a web server running SQL and returns a JSON object.
JSON stands for JavaScript Object Notation.
JSON, much like XML, is syntax for storing and exchanging text information.
One example of JSON objects is shown on the right.
The script is used in the file Student.html , where the method JSON.parse parses a string as JSON.
|
|
[
{
"Name": "Alfreds Futterkiste",
"City": "Berlin",
"Country": "Germany"
},
{
"Name": "Berglunds snabbköp",
"City": "Luleå",
"Country": "Sweden"
},
{
"Name": "Island Trading",
"City": "Cowes",
"Country": "UK"
},
{
"Name": "Ernst Handel",
"City": "Graz",
"Country": "Austria"
},
{
"Name": "FISSA Fabrica Inter.",
"City": "Madrid",
"Country": "Spain"
}
]
|
|