Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with format of json data when ajax call #65

Closed
kspal opened this issue Apr 22, 2013 · 3 comments
Closed

problem with format of json data when ajax call #65

kspal opened this issue Apr 22, 2013 · 3 comments

Comments

@kspal
Copy link

kspal commented Apr 22, 2013

Hi,

in your doc you says the ajax call must return JSON data in the following format
{
query:'Li',
suggestions:['Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lithuania'],
data:['LR', 'LY', 'LI', 'LT']
}

i don't know if you change something but it doesn't work me. The following format work for me :

{"query":"Li",
"suggestions":[{"value":"Liberia","data":"LR"},{"value":"'Libyan Arab Jamahiriya","data":"LY"}]
}

NB I use the 1.2.5 version

Does i miss something ? or is this a little bug in the doc ?

Sincerly

Thanks for you great job.

Kspal

@tkirda
Copy link
Member

tkirda commented Apr 22, 2013

Hi, documentation says: "JSON formatted JavaScript object". Which means it should be valid JSON. You can validate your json at http://jsonlint.com/

@tkirda tkirda closed this as completed Apr 22, 2013
@kspal
Copy link
Author

kspal commented Apr 23, 2013

hi, i know my json is valid.
My point is about the structure of the json which is different from what you wrote on your website.
Just look the difference in "suggestions" entry between the two example...

@tkirda
Copy link
Member

tkirda commented Apr 23, 2013

Actually format has changed as of version 1.2 and is updated on the project page: https://github.com/devbridge/jQuery-Autocomplete#response-format

Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants