Passing links from JSON in listview

Passing links from JSON in listview

Hi All,

I have been looking at the listview autocomplete demos online for local and remote data. 

In the remote data demo a list of cities is loaded from remote data, but there are no links in the 'search results'. See here:   http://demos.jquerymobile.com/1.4.3/listview-autocomplete-remote/

However, In the local data example the list generated contains links to the search content (see below - eg if you search audi, you can click the list item 'Audi' to be taken to audi.html).


< ul data-role = "listview" data-filter = "true" data-filter-reveal = "true" data-filter-placeholder = "Search cars..." >
     < li >< a href = "acura.html" >Acura</ a ></ li >
     < li >< a href = "audi.html" >Audi</ a ></ li >
   ...
</ ul >

I would really like to pass links from the JSON file so that users can clicnk on the search results to be redirected to content. Can anyone help?

For example, say the JSON looked like below:

[{ "car": "Acura", "link": "acura.html" },{ "car": "Audi", "link": "audi.html" }]

How should i change the JS / HTML in order to get the links to work?

Thanks very much in advance for any help anyone can give.


PS:: what does this mean? Do i have to change this is the JSON is stored on the same server/domain?

                 crossDomain: true ,