I’m making a simple javascript app that needs to run locally (on a CD without internet) and it’s basically a enhanced image gallery. There are a lot of files that need to be “loaded”, so I’m putting the files in a json format, like this:
{
number: 338,
images:
[
{
picture_path : "path/file.png",
place : "Brazil",
metadata : "...",
},
{
...
}
]
}
My question is, how I can get and structure this data? Is there a Jquery getJSON locally method/parser? It seems that I can reparse the json using javascript eval, but how can I get the content?? Also, is there a way to find info on the give structure data, for instance, suppose that I want all pictures from “Brazil”.
I was thinking on embedding a php server and reading, but I thought this is too much trouble…..
To address the question regarding reading json directly from disk using jquery, getJSON supports this; from their documentation at http://api.jquery.com/jQuery.getJSON/