fastselect icon indicating copy to clipboard operation
fastselect copied to clipboard

cannot load json from url response

Open yelnyafacee opened this issue 8 years ago • 2 comments

hi, I am trying to load json from a url like:

url: 'http://localhost/webiste/public/admin/restaurant/getpaymentoptions'

and it is not working even though the URL return the result:

[{"text":"Cash","value":"Cash"},{"text":"Mastercard","value":"Mastercard"},{"text":"Visa","value":"Visa"}, .....}]

is file.json the only format this plugin recognize? what should I do to make it get the json from the URL response?

yelnyafacee avatar Jul 18 '17 13:07 yelnyafacee

Any error in the browser console?

Is your server returning the json object as a json response or as a html/text response? You have to return it as json response to make it work. Good luck.

xAlstrat avatar Jul 24 '17 03:07 xAlstrat

I am having the same issue. I am using a Coldfusion CFC to return the results in a json format and the data IS returning in the developer tools / network view and I can search and get just those results but they do not populate the input at all. I get the error: "Cannot use 'in' operator to search for 'length' in [{"text":"Account Manager (MM)","value":"Account Manager (MM)"}," (etc.... didn't copy all results here)

Does this plugin only recognize a .json file?

jenathrash avatar Aug 11 '17 20:08 jenathrash