I am developing a mapping tool, and I am using jQuery to download JSON data from a server. the code for the jquery is currently:
$.getJSON("start.json", function(data) {
var items = [];
$.each(data, function(key, val) {
alert("data: " + key + "->" + val);
});
});
the json file looks like this:
{
"type" : "obstacle",
"top" : 20,
"left" : 10,
"height": 50,
"width" : 70,
"tall" : 10
}
now, the "problem" is that, as it can be seen clearly, in this format, the json can only contain one object. how do I have to structure my file (and consequently my jquery) to have more than one object?
Thanks in advance.