[jQuery] Autocomplete plugin: Modifying how the input JSON is read

[jQuery] Autocomplete plugin: Modifying how the input JSON is read


Hi,
I use the autocomplete plugin, but don't have a JSON that consists of
an simple array with the results. I get the JSON directly from a
SPARQL end point, so I don't have the option to format it at that
point. I want to modify the autocomplete plugin so that it handles the
following JSON:
{
"head": {
"vars": [ "label" ]
} ,
"results": {
"bindings": [
{
"label": { "type": "literal" , "xml:lang": "no" , "value":
"Barnevaksinasjonsprogrammet" }
} ,
{
"label": { "type": "literal" , "xml:lang": "no" , "value":
"Barnesykdommer" }
} ,
{
"label": { "type": "literal" , "xml:lang": "no" , "value":
"Barn" }
}
]
}
}
From this I want the "value" to be listed in the autocompletion. So
that Barnevaksinasjonsprogrammet, Barnesykdommer and Barn is the
autocomplete options.
Where in the code do I do this, or is this configurable?
- Magnus